tabAll.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292
  1. <template>
  2. <van-nav-bar
  3. title="智慧“和顺”"
  4. left-text="民宗干事"
  5. left-arrow
  6. @click-left="onClickLeft"
  7. />
  8. <!-- <van-image
  9. width="100%"
  10. height="10rem"
  11. fit="cover"
  12. src="https://img1.baidu.com/it/u=2086445453,3056906789&fm=253&fmt=auto&app=138&f=GIF?w=1378&h=400"
  13. /> -->
  14. <van-swipe :autoplay="3000" lazy-render>
  15. <van-swipe-item v-for="image in BannerImgurls" :key="image" >
  16. <van-image width="100%" height="10rem" fit="cover" :src="image" />
  17. </van-swipe-item>
  18. </van-swipe>
  19. <div class="tabtitlelay">
  20. <div class="tabtitle1"></div>
  21. <div class="tabtitle">我的待办</div>
  22. <div class="tabtitle2">(</div>
  23. <div class="tabtitle3">15</div>
  24. <div class="tabtitle4">)</div>
  25. <van-icon name="ellipsis" class="tabtitle5" @click="goToBeDone" />
  26. </div>
  27. <div class="flexll">
  28. <div class="ffl2">
  29. <div class="textRegular">待处理</div>
  30. <div class="textRed">{{con1}}</div>
  31. </div>
  32. <div class="verticalLine"></div>
  33. <div class="ffl2">
  34. <div class="textRegular">已处理</div>
  35. <div class="textBlue">8</div>
  36. </div>
  37. </div>
  38. <div class="hLine"></div>
  39. <div class="tabtitlelay">
  40. <div class="tabtitle1"></div>
  41. <div class="tabtitle">场所管理</div>
  42. </div>
  43. <van-grid :border="false">
  44. <van-grid-item icon="../../../loginbg/csdj.png" text="场所登记" />
  45. <van-grid-item icon="../../../loginbg/csry.png" text="场所人员信息" />
  46. <van-grid-item icon="../../../loginbg/cspw.png" text="牌位管理" />
  47. </van-grid>
  48. <div class="hLine"></div>
  49. <div class="tabtitlelay">
  50. <div class="tabtitle1"></div>
  51. <div class="tabtitle">活动管理</div>
  52. </div>
  53. <van-grid :border="false" >
  54. <van-grid-item icon="../../../loginbg/hd_cshd.png" @click="placeActivity" text="场所活动" />
  55. <van-grid-item icon="../../../loginbg/hd_ssjhd.png" @click="selfMeetingList" text="私设聚会点" />
  56. <van-grid-item icon="../../../loginbg/hd_xjqz.png" @click="abnormalCrowd" text="信教群众异常" />
  57. <van-grid-item icon="../../../loginbg/hd_jc.png" text="场所检查" @click="tohd_jc" />
  58. <van-grid-item icon="../../../loginbg/hd_af.png" text="安防设施异常" @click="tohd_af" />
  59. <van-grid-item icon="../../../loginbg/hd_hy.png" text="负责人会议" @click="tohd_hy" />
  60. <van-grid-item icon="../../../loginbg/hd_qt.png" to="/setting" text="其他" @click="tohd_qt" />
  61. </van-grid>
  62. </template>
  63. <script>
  64. import tool from "@/tool";
  65. import qs from "qs";
  66. import onlineXm from "../../utils/onlineXm"
  67. export default {
  68. data() {
  69. return{
  70. title:'民宗干事',
  71. username:"",
  72. sms:"",
  73. password:"",
  74. password2:"",
  75. con1:"0",
  76. BannerImgurls:['https://img1.baidu.com/it/u=2086445453,3056906789&fm=253&fmt=auto&app=138&f=GIF?w=1378&h=400','https://img1.baidu.com/it/u=2086445453,3056906789&fm=253&fmt=auto&app=138&f=GIF?w=1378&h=400']
  77. }
  78. },
  79. created(){
  80. let id=this.$route.query.id;
  81. this.TokenLogin();
  82. this.getBannerImg();//获取轮播图
  83. this.getSelectColor();//获取主题颜色
  84. },
  85. methods:{
  86. goToBeDone() {
  87. this.$router.push("/toBeDone");
  88. },
  89. onClickLeft(){
  90. history.back();
  91. },
  92. tohd_jc(){
  93. //this.onlineXm.xmNavTo("../activityMan\siteInspection\siteInspectionList");
  94. this.$router.push("/siteInspectionList");
  95. },
  96. tohd_af(){
  97. this.$router.push("/securityFacilitiesErrList");
  98. },
  99. tohd_hy(){
  100. this.$router.push("/religiousConferenceList");
  101. },
  102. tohd_qt(){
  103. this.$router.push("/securityFacilitiesErrList");
  104. },
  105. // 活动场所
  106. placeActivity(){
  107. this.$router.push("/placeActivityList")
  108. },
  109. selfMeetingList(){
  110. this.$router.push("/selfMeetingList")
  111. },
  112. abnormalCrowd(){
  113. this.$router.push("/abnormalCrowd")
  114. },
  115. async TokenLogin(){
  116. let that=this;
  117. //添加PCtoken过期判断,(请求拦截到token过期,会设置PCtoken为空,为空的时候再调用免登功能)
  118. if(this.$store.state.pctoken==""||this.$store.state.pctoken==undefined){
  119. //SDK中 getToken() 方法获取免登token
  120. //window.xm.getToken().then(async function(token){//上线取消注释
  121. let token="test";//上线注释
  122. const inputForm =qs.stringify({
  123. 'token': token
  124. }, { allowDots: true, arrayFormat: 'indices' })
  125. var res = await this.$API.yin.TokenLogin.get(inputForm);
  126. //存PCtoken
  127. this.$store.commit('setPcToken',res.PcToken);
  128. this.$store.commit('setUser',res.account);
  129. //})//上线取消注释
  130. }
  131. },
  132. //获取轮播图
  133. async getBannerImg(){
  134. const inputForm =qs.stringify({
  135. 'current': 1,
  136. 'size': 5,
  137. 'orders':[],
  138. }, { allowDots: true, arrayFormat: 'indices' })
  139. var res = await this.$API.my.BannerImg.get(inputForm);
  140. let bs=[];
  141. for(let i=0;i<res.records.length;i++){
  142. bs.push(res.records[i].bannerImg);
  143. }
  144. //需添加url拼接
  145. //this.BannerImgurls=bs;
  146. //console.log(this.BannerImgurls);
  147. },
  148. //获取主题颜色
  149. async getSelectColor(){
  150. const inputForm =qs.stringify({
  151. 'current': 1,
  152. 'size': 5,
  153. 'orders':[],
  154. }, { allowDots: true, arrayFormat: 'indices' })
  155. var res = await this.$API.my.SelectColor.get(inputForm);
  156. //默认取出列表第一条的色值使用,注意轻应用文档中(后面直接跟6位十六进制色值,不需要#)
  157. console.log(res.records[0].selectColor.substring(1, 7));
  158. //存PCtoken
  159. this.$store.commit('setSelectColor',res.records[0].selectColor.substring(1, 7));
  160. },
  161. //测试接口,可删除
  162. async gettest(){
  163. let that=this;
  164. //SDK中 getToken() 方法获取免登token
  165. window.xm.getToken().then(function(token){
  166. console.log(token);
  167. that.con1="哈哈"+token;
  168. window.xm.showToast({
  169. message:that.con1
  170. })
  171. })
  172. //测试数据同步接口的
  173. const inputForm ={
  174. 'iamRequestId': '120010',
  175. 'iamRemoteUser': 'admin12022',
  176. 'iamRemotePwd': ''
  177. }
  178. var res = await this.$API.yin.SchemaService.post(inputForm);
  179. if (res.type == 1) {
  180. this.$router.replace({
  181. path: "/main",
  182. });
  183. } else {
  184. Toast.fail(res.message);
  185. }
  186. },
  187. //测试接口,可删除
  188. async gettest2(){
  189. var datas = {
  190. username: "admin",
  191. };
  192. var res = await this.$API.my.OrderDetails.get(datas);
  193. this.con1=res;
  194. console.log(res);
  195. },
  196. //用户数据同步测试用(用户保存)
  197. async gettestUser1(){
  198. const inputForm ={
  199. 'iamRequestId': '120010',
  200. 'iamRemoteUser': 'admin',
  201. 'iamRemotePwd': '11',
  202. 'loginName': 'yzt2',
  203. 'name': '同步用户2',
  204. 'password': '111',
  205. 'idcard': '320911199010000002',
  206. 'email': '818166662@qq.com',
  207. 'phone': '88868882',
  208. 'mobile': '1829999992',
  209. 'loginFlag': '1',
  210. 'photo': '',
  211. 'sign': '个性签名2',
  212. }
  213. var res = await this.$API.yin.UserCreateService.post(inputForm);
  214. console.log(res);
  215. },
  216. //(用户更新)
  217. async gettestUser2(){
  218. const inputForm ={
  219. 'iamRequestId': '120010',
  220. 'iamRemoteUser': 'admin',
  221. 'iamRemotePwd': '11',
  222. 'uid': '1639158103696228354',
  223. 'loginName': 'yzt222',
  224. 'name': '11',
  225. // 'password': '',
  226. // 'idcard': '',
  227. // 'email': '',
  228. // 'phone': '',
  229. // 'mobile': '',
  230. // 'loginFlag': '',
  231. // 'photo': '',
  232. // 'sign': '',
  233. }
  234. var res = await this.$API.yin.UserUpdateService.post(inputForm);
  235. console.log(res);
  236. },
  237. //(用户删除)
  238. async gettestUser3(){
  239. const inputForm ={
  240. 'iamRequestId': '120010',
  241. 'iamRemoteUser': 'admin',
  242. 'iamRemotePwd': '111',
  243. 'uid': '1639158103696228354',
  244. }
  245. var res = await this.$API.yin.UserDeleteService.post(inputForm);
  246. console.log(res);
  247. },
  248. },
  249. };
  250. </script>
  251. <style>
  252. </style>