tabAll.vue 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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="场所登记" @click="goPlaceRegister"/>
  45. <van-grid-item icon="../../../loginbg/csry.png" text="场所人员信息" @click="goPlacePerson" />
  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 userSets from "@/api/sys/userSets";
  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.TokenLogin2();
  82. this.getBannerImg();//获取轮播图
  83. this.getSelectColor();//获取主题颜色
  84. },
  85. methods:{
  86. goToBeDone() {
  87. this.$router.push("/toBeDone");
  88. },
  89. goPlaceRegister() {
  90. this.$router.push("/placeRegister");
  91. },
  92. goPlacePerson() {
  93. this.$router.push("/placePerson");
  94. },
  95. onClickLeft(){
  96. history.back();
  97. },
  98. tohd_jc(){
  99. //this.onlineXm.xmNavTo("../activityMan\siteInspection\siteInspectionList");
  100. this.$router.push("/siteInspectionList");
  101. },
  102. tohd_af(){
  103. this.$router.push("/securityFacilitiesErrList");
  104. },
  105. tohd_hy(){
  106. this.$router.push("/religiousConferenceList");
  107. },
  108. tohd_qt(){
  109. this.$router.push("/securityFacilitiesErrList");
  110. },
  111. // 活动场所
  112. placeActivity(){
  113. this.$router.push("/placeActivityList")
  114. },
  115. selfMeetingList(){
  116. this.$router.push("/selfMeetingList")
  117. },
  118. abnormalCrowd(){
  119. this.$router.push("/abnormalCrowd")
  120. },
  121. async TokenLogin(){
  122. let that=this;
  123. //添加PCtoken过期判断,(请求拦截到token过期,会设置PCtoken为空,为空的时候再调用免登功能)
  124. if(this.$store.state.pctoken==""||this.$store.state.pctoken==undefined){
  125. //SDK中 getToken() 方法获取免登token
  126. //window.xm.getToken().then(async function(token){//上线取消注释
  127. let token="test";//上线注释
  128. const inputForm =qs.stringify({
  129. 'token': token
  130. }, { allowDots: true, arrayFormat: 'indices' })
  131. var res = await this.$API.yin.TokenLogin.get(inputForm);
  132. //存PCtoken
  133. this.$store.commit('setPcToken',res.PcToken);
  134. this.$store.commit('setUser',res.account);
  135. //})//上线取消注释
  136. }
  137. },
  138. TokenLogin2(){
  139. let that=this;
  140. //添加PCtoken过期判断,(请求拦截到token过期,会设置PCtoken为空,为空的时候再调用免登功能)
  141. if(this.$store.state.pctoken==""||this.$store.state.pctoken==undefined){
  142. //SDK中 getToken() 方法获取免登token
  143. //window.xm.getToken().then(async function(token){//上线取消注释
  144. let token="test";//上线注释
  145. new userSets()
  146. .TokenLogin({
  147. token: token
  148. })
  149. .then((res) => {
  150. that.$store.commit('setPcToken',res.PcToken);
  151. that.$store.commit('setUser',res.account);
  152. });
  153. //})//上线取消注释
  154. }
  155. },
  156. getBannerImg(){
  157. new userSets()
  158. .BannerImg({
  159. 'current': 1,
  160. 'size': 5,
  161. 'orders':[],
  162. })
  163. .then((res) => {
  164. let bs=[];
  165. for(let i=0;i<res.records.length;i++){
  166. bs.push(res.records[i].bannerImg);
  167. }
  168. //需添加url拼接
  169. //this.BannerImgurls=bs;
  170. //console.log(this.BannerImgurls);
  171. });
  172. },
  173. getSelectColor(){
  174. let that=this;
  175. new userSets()
  176. .SelectColor({
  177. 'current': 1,
  178. 'size': 5,
  179. 'orders':[],
  180. })
  181. .then((res) => {
  182. //console.log(res.records[0].selectColor.substring(1, 7));
  183. //存PCtoken
  184. that.$store.commit('setSelectColor',res.records[0].selectColor.substring(1, 7));
  185. });
  186. },
  187. //测试接口,可删除
  188. async gettest(){
  189. let that=this;
  190. //SDK中 getToken() 方法获取免登token
  191. window.xm.getToken().then(function(token){
  192. console.log(token);
  193. that.con1="哈哈"+token;
  194. window.xm.showToast({
  195. message:that.con1
  196. })
  197. })
  198. //测试数据同步接口的
  199. const inputForm ={
  200. 'iamRequestId': '120010',
  201. 'iamRemoteUser': 'admin12022',
  202. 'iamRemotePwd': ''
  203. }
  204. var res = await this.$API.yin.SchemaService.post(inputForm);
  205. if (res.type == 1) {
  206. this.$router.replace({
  207. path: "/main",
  208. });
  209. } else {
  210. Toast.fail(res.message);
  211. }
  212. },
  213. //测试接口,可删除
  214. async gettest2(){
  215. var datas = {
  216. username: "admin",
  217. };
  218. var res = await this.$API.my.OrderDetails.get(datas);
  219. this.con1=res;
  220. console.log(res);
  221. },
  222. //用户数据同步测试用(用户保存)
  223. async gettestUser1(){
  224. const inputForm ={
  225. 'iamRequestId': '120010',
  226. 'iamRemoteUser': 'admin',
  227. 'iamRemotePwd': '11',
  228. 'loginName': 'yzt2',
  229. 'name': '同步用户2',
  230. 'password': '111',
  231. 'idcard': '320911199010000002',
  232. 'email': '818166662@qq.com',
  233. 'phone': '88868882',
  234. 'mobile': '1829999992',
  235. 'loginFlag': '1',
  236. 'photo': '',
  237. 'sign': '个性签名2',
  238. }
  239. var res = await this.$API.yin.UserCreateService.post(inputForm);
  240. console.log(res);
  241. },
  242. //(用户更新)
  243. async gettestUser2(){
  244. const inputForm ={
  245. 'iamRequestId': '120010',
  246. 'iamRemoteUser': 'admin',
  247. 'iamRemotePwd': '11',
  248. 'uid': '1639158103696228354',
  249. 'loginName': 'yzt222',
  250. 'name': '11',
  251. // 'password': '',
  252. // 'idcard': '',
  253. // 'email': '',
  254. // 'phone': '',
  255. // 'mobile': '',
  256. // 'loginFlag': '',
  257. // 'photo': '',
  258. // 'sign': '',
  259. }
  260. var res = await this.$API.yin.UserUpdateService.post(inputForm);
  261. console.log(res);
  262. },
  263. //(用户删除)
  264. async gettestUser3(){
  265. const inputForm ={
  266. 'iamRequestId': '120010',
  267. 'iamRemoteUser': 'admin',
  268. 'iamRemotePwd': '111',
  269. 'uid': '1639158103696228354',
  270. }
  271. var res = await this.$API.yin.UserDeleteService.post(inputForm);
  272. console.log(res);
  273. },
  274. },
  275. };
  276. </script>
  277. <style>
  278. </style>