index.vue 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373
  1. <template>
  2. <div>
  3. <view class="tabbar">
  4. <div class="tabbarbg">
  5. <u--image
  6. src="/static/img/menu_light@2x.png"
  7. width="100vw"
  8. height="81px"
  9. ></u--image>
  10. </div>
  11. <view
  12. class="tabbarItem"
  13. @click="handleItem(item, index)"
  14. :class="{ activeMenu: active == index }"
  15. v-for="(item, index) in list"
  16. :key="index"
  17. >
  18. <div :class="{ aotoImg: index == 2 }">
  19. <u--image
  20. :src="active == index ? item.active : item.light"
  21. :width="index == 2 ? '50px' : '48px'"
  22. :height="index == 2 ? '50px' : '48px'"
  23. ></u--image>
  24. </div>
  25. <div class="hightImg" v-show="active == index">
  26. <u--image
  27. src="https://4dscene.4dage.com/new4dkk/deng/static/img/icon_active@2x.png"
  28. width="68px"
  29. height="81px"
  30. ></u--image>
  31. </div>
  32. <view class="tabbarItemText" :class="{ active: active == index }">{{
  33. item.name
  34. }}</view>
  35. </view>
  36. </view>
  37. <u-popup
  38. closeIconPos="bottom-right"
  39. :show="show"
  40. mode="center"
  41. round="10"
  42. bgColor="transparent"
  43. @close="close"
  44. @open="open"
  45. >
  46. <view class="codeData" :style="{backgroundImage: `url(${codeImg})`}">
  47. <div class="close" @click="close">
  48. <u--image
  49. width="42px"
  50. height="42px"
  51. src="https://4dscene.4dage.com/new4dkk/deng/static/img/icon_cancel@2x.png"
  52. ></u--image>
  53. </div>
  54. <!-- <view class="text">
  55. <u--image
  56. width="100%"
  57. height="185px"
  58. src="https://4dscene.4dage.com/new4dkk/v2/lang/images/solutions/government/survey1.png"
  59. ></u--image>
  60. <div class="text-center pt-20 pb-8 text-2xl">一花五叶</div>
  61. <u--image
  62. width="100%"
  63. height="10px"
  64. src="https://4dscene.4dage.com/new4dkk/deng/static/img/line@2x.png"
  65. ></u--image>
  66. <div class="codeDataText">
  67. 此灯组以禅宗“一花五叶”为主题,传承禅宗经典。您可欣赏花开五叶的意象,感受南宗禅衍化出临济、曹洞、法眼、沩仰和云门五家,发展壮大的辉煌历史,领悟慧能大师法脉的深邃智慧。
  68. </div>
  69. <div class="codeImg">
  70. <QiyanQrcode
  71. @click="title1 = '1.现在时间戳:' + Date.now()"
  72. :text="title1"
  73. ></QiyanQrcode>
  74. <up-qrcode
  75. :size="72"
  76. val="uview-plus"
  77. icon="https://uview-plus.jiangruyi.com/uview-plus/common/logo.png"
  78. ></up-qrcode>
  79. </div>
  80. </view> -->
  81. <view class="codebutList">
  82. <!-- <div class="downText" v-if="false">
  83. <div class="img flex justify-center items-center">
  84. <div style="width: 36px; height: 36px">
  85. <u--image
  86. width="36px"
  87. height="36px"
  88. src="https://4dscene.4dage.com/new4dkk/deng/static/img/icon_download@2x.png"
  89. ></u--image>
  90. </div>
  91. <div class="pl-10">下载图片</div>
  92. </div>
  93. <div class="tips">完成6处打卡,即可点灯祈愿</div>
  94. </div> -->
  95. <div class="downButtom flex justify-center">
  96. <div class="downButtomItem">下载图片</div>
  97. <div class="downButtomItem" @click="handleqiyan">去祈愿</div>
  98. </div>
  99. </view>
  100. </view>
  101. </u-popup>
  102. </div>
  103. </template>
  104. <script>
  105. import { mapState } from "vuex";
  106. import QiyanQrcode from "@/components/qiyan-qrcode/qiyan-qrcode.vue";
  107. // import uButton from "uview-ui/components/u-button/u-button.vue";
  108. export default {
  109. components: {
  110. QiyanQrcode,
  111. },
  112. props: {
  113. type: {
  114. type: Boolean,
  115. default: false,
  116. },
  117. },
  118. data() {
  119. return {
  120. show: false,
  121. title1: "1.现在时间戳:" + Date.now(),
  122. codeImg: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/01.png',
  123. codeList:{
  124. code1: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/01.png',
  125. code2: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/01.png',
  126. code3: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/01.png',
  127. code4: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/01.png',
  128. code5: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/01.png',
  129. code6: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/01.png',
  130. code7: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/02.png',
  131. code8: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/01.png',
  132. code9: 'https://4dscene.4dage.com/new4dkk/deng/static/img/code/12.png',
  133. },
  134. list: [
  135. {
  136. active: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_scan_active@2x.png",
  137. dark: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_scan_dark@2x.png",
  138. light: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_scan_light@2x.png",
  139. name: "扫码打卡",
  140. },
  141. {
  142. active: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_lotus_active@2x.png",
  143. dark: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_lotus_dark@2x.png",
  144. light: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_lotus_light@2x.png",
  145. name: "点亮",
  146. url: "https://sit-nanhuacs.4dage.com/web/index.html#/prayers/list",
  147. },
  148. {
  149. active: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_map_active@2x.png",
  150. dark: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_map_dark@2x.png",
  151. light: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_map_light@2x.png",
  152. name: "地图",
  153. path: "/pages/home/map",
  154. url: "https://sit-nanhuacs.4dage.com/web/index.html#/map",
  155. },
  156. {
  157. active: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_ai_active@2x.png",
  158. dark: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_ai_dark@2x.png",
  159. light: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_ai_light@2x.png",
  160. name: "妙笔生花",
  161. url: "https://sit-nanhuacs.4dage.com/web/index.html#/composite",
  162. },
  163. {
  164. active: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_user_active@2x.png",
  165. dark: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_user_dark@2x.png",
  166. light: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_user_light@2x.png",
  167. name: "我的",
  168. },
  169. ],
  170. title: "Hello",
  171. };
  172. },
  173. computed: {
  174. ...mapState(["active"]),
  175. },
  176. onLoad() {},
  177. methods: {
  178. handleItem(item, index) {
  179. let obj = {
  180. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=1':this.codeList.code1,
  181. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=2':this.codeList.code2,
  182. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=3':this.codeList.code3,
  183. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=4':this.codeList.code4,
  184. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=5':this.codeList.code5,
  185. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=6':this.codeList.code6,
  186. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=7':this.codeList.code7,
  187. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=8':this.codeList.code8,
  188. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=9':this.codeList.code9,
  189. };
  190. let objclockIn = {
  191. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=1':'SG-PHP2F5mD35e',
  192. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=2':'SG-PHP2F5mD35e',
  193. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=3':'SG-PHP2F5mD35e',
  194. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=4':'SG-PHP2F5mD35e',
  195. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=5':'SG-PHP2F5mD35e',
  196. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=6':'SG-PHP2F5mD35e',
  197. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=7':'SG-PHP2F5mD35e',
  198. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=8':'SG-PHP2F5mD35e',
  199. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=9':'SG-PHP2F5mD35e',
  200. };
  201. let that = this;
  202. if (item.name == "扫码打卡") {
  203. // 只允许通过相机扫码
  204. uni.scanCode({
  205. onlyFromCamera: true,
  206. success: function (res) {
  207. console.log("条码类型:" + res.scanType);
  208. console.log("条码内容:" + res.result);
  209. that.show = true;
  210. that.codeImg = obj[res.result];
  211. that.$store.commit("changeActive", index);
  212. that.getRequest('/api/wx/clockIn', {code: objclockIn[res.result]})
  213. },
  214. fail: function (e) {
  215. console.log("扫码失败", e);
  216. that.$store.commit("changeActive", 4);
  217. that.show = true;
  218. },
  219. });
  220. return;
  221. } else if (item.name == "我的") {
  222. }
  223. this.$store.commit("changeActive", index);
  224. if (item.url){
  225. uni.$u.route("/pages/home/webview", {
  226. url: item.url,
  227. index: index,
  228. });
  229. }
  230. },
  231. handleHome() {
  232. console.log("开启云上观灯", uni);
  233. uni.$u.route("/pages/home/home");
  234. },
  235. handleqiyan() {
  236. uni.$u.route("/pages/home/webview", {
  237. url: 'https://sit-nanhuacs.4dage.com/web/index.html#/prayers/list',
  238. });
  239. },
  240. close() {
  241. this.show = false;
  242. // console.log('close');
  243. },
  244. open() {},
  245. },
  246. };
  247. </script>
  248. <style lang="less" scoped>
  249. .tabbar {
  250. display: flex;
  251. align-items: center;
  252. justify-content: space-around;
  253. position: fixed;
  254. bottom: 0;
  255. width: 100vw;
  256. z-index: 1000;
  257. height: 81px;
  258. left: 0;
  259. padding: -2px 0 16px 0;
  260. .tabbarbg {
  261. position: absolute;
  262. left: 0;
  263. right: 0;
  264. bottom: 0;
  265. }
  266. .tabbarItem {
  267. text-align: center;
  268. width: 50px;
  269. font-weight: 400;
  270. font-size: 11px;
  271. color: #303030;
  272. line-height: 13px;
  273. text-align: center;
  274. position: relative;
  275. z-index: 1;
  276. .hightImg {
  277. position: absolute;
  278. z-index: 2;
  279. top: 0;
  280. left: -10px;
  281. }
  282. .aotoImg {
  283. position: relative;
  284. top: -5px;
  285. }
  286. }
  287. }
  288. .codeData {
  289. // background: url(https://4dscene.4dage.com/new4dkk/deng/static/img/pop2@2x.png) no-repeat cover;
  290. background: url(https://4dscene.4dage.com/new4dkk/deng/static/img/code1.png)
  291. 100% 100% no-repeat;
  292. background-size: 100% auto;
  293. width: calc(100vw - 108px);
  294. height: 490px;
  295. padding: 48px 52px 30px 36px;
  296. position: relative;
  297. .close {
  298. position: absolute;
  299. right: -0px;
  300. top: -0px;
  301. width: 42px;
  302. height: 42px;
  303. }
  304. .text {
  305. font-weight: 400;
  306. font-size: 24px;
  307. color: #d86332;
  308. line-height: 29px;
  309. position: relative;
  310. padding-bottom: 72px;
  311. .codeDataText {
  312. padding: 8px 0 16px 0;
  313. font-weight: 400;
  314. font-size: 14px;
  315. color: #b1967b;
  316. line-height: 18px;
  317. text-align: left;
  318. }
  319. .codeImg {
  320. text-align: right;
  321. width: 72px;
  322. height: 72px;
  323. float: right;
  324. }
  325. }
  326. .codebutList {
  327. text-align: center;
  328. text-align: center;
  329. position: absolute;
  330. bottom: -42px;
  331. width: 100%;
  332. left: 0;
  333. margin: 0 auto;
  334. .downText {
  335. .img {
  336. margin-right: 10px;
  337. font-weight: 400;
  338. font-size: 16px;
  339. color: #ffffff;
  340. line-height: 19px;
  341. text-align: center;
  342. }
  343. .tips {
  344. padding-top: 10px;
  345. font-weight: 400;
  346. font-size: 16px;
  347. color: #a49d94;
  348. line-height: 19px;
  349. text-align: center;
  350. }
  351. }
  352. .downButtom {
  353. .downButtomItem {
  354. width: 140px;
  355. height: 42px;
  356. background: url(https://4dscene.4dage.com/new4dkk/deng/static/img/btn01@2x.png)
  357. 100% 100% no-repeat;
  358. background-size: cover;
  359. font-weight: 400;
  360. font-size: 16px;
  361. color: #ffffff;
  362. line-height: 19px;
  363. font-style: normal;
  364. margin: 0 5px;
  365. line-height: 42px;
  366. text-align: center;
  367. }
  368. }
  369. }
  370. }
  371. </style>