index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380
  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_home_active.png',
  137. dark: 'https://4dscene.4dage.com/new4dkk/deng/static/img/icon_home_dark.png',
  138. light: 'https://4dscene.4dage.com/new4dkk/deng/static/img/icon_home_light.png',
  139. name: '首页',
  140. url: "https://sit-nanhuacs.4dage.com/web/index.html#/home",
  141. },
  142. {
  143. active: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_scan_active@2x.png",
  144. dark: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_scan_dark@2x.png",
  145. light: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_scan_light@2x.png",
  146. name: "扫码打卡",
  147. },
  148. {
  149. active: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_lotus_active@2x.png",
  150. dark: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_lotus_dark@2x.png",
  151. light: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_lotus_light@2x.png",
  152. name: "点亮",
  153. url: "https://sit-nanhuacs.4dage.com/web/index.html#/prayers/list",
  154. },
  155. {
  156. active: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_map_active@2x.png",
  157. dark: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_map_dark@2x.png",
  158. light: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_map_light@2x.png",
  159. name: "地图",
  160. path: "/pages/home/map",
  161. url: "https://sit-nanhuacs.4dage.com/web/index.html#/map",
  162. },
  163. {
  164. active: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_ai_active@2x.png",
  165. dark: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_ai_dark@2x.png",
  166. light: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_ai_light@2x.png",
  167. name: "妙笔生花",
  168. url: "https://sit-nanhuacs.4dage.com/web/index.html#/composite",
  169. },
  170. // {
  171. // active: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_user_active@2x.png",
  172. // dark: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_user_dark@2x.png",
  173. // light: "https://4dscene.4dage.com/new4dkk/deng/static/img/icon_user_light@2x.png",
  174. // name: "我的",
  175. // },
  176. ],
  177. title: "Hello",
  178. };
  179. },
  180. computed: {
  181. ...mapState(["active"]),
  182. },
  183. onLoad() {},
  184. methods: {
  185. handleItem(item, index) {
  186. let obj = {
  187. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=1':this.codeList.code1,
  188. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=2':this.codeList.code2,
  189. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=3':this.codeList.code3,
  190. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=4':this.codeList.code4,
  191. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=5':this.codeList.code5,
  192. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=6':this.codeList.code6,
  193. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=7':this.codeList.code7,
  194. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=8':this.codeList.code8,
  195. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=9':this.codeList.code9,
  196. };
  197. let objclockIn = {
  198. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=1':'SG-PHP2F5mD35e',
  199. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=2':'SG-PHP2F5mD35e',
  200. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=3':'SG-PHP2F5mD35e',
  201. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=4':'SG-PHP2F5mD35e',
  202. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=5':'SG-PHP2F5mD35e',
  203. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=6':'SG-PHP2F5mD35e',
  204. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=7':'SG-PHP2F5mD35e',
  205. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=8':'SG-PHP2F5mD35e',
  206. 'https://houseoss.4dkankan.com/project/nanHua/index.html#/code?m=9':'SG-PHP2F5mD35e',
  207. };
  208. let that = this;
  209. if (item.name == "扫码打卡") {
  210. // 只允许通过相机扫码
  211. uni.scanCode({
  212. onlyFromCamera: true,
  213. success: function (res) {
  214. console.log("条码类型:" + res.scanType);
  215. console.log("条码内容:" + res.result);
  216. that.show = true;
  217. that.codeImg = obj[res.result];
  218. that.$store.commit("changeActive", index);
  219. that.getRequest('/api/wx/clockIn', {code: objclockIn[res.result]})
  220. },
  221. fail: function (e) {
  222. console.log("扫码失败", e);
  223. that.$store.commit("changeActive", 4);
  224. that.show = true;
  225. },
  226. });
  227. return;
  228. } else if (item.name == "我的") {
  229. }
  230. this.$store.commit("changeActive", index);
  231. if (item.url){
  232. uni.$u.route("/pages/home/webview", {
  233. url: item.url,
  234. index: index,
  235. });
  236. }
  237. },
  238. handleHome() {
  239. console.log("开启云上观灯", uni);
  240. uni.$u.route("/pages/home/home");
  241. },
  242. handleqiyan() {
  243. uni.$u.route("/pages/home/webview", {
  244. url: 'https://sit-nanhuacs.4dage.com/web/index.html#/prayers/list',
  245. });
  246. },
  247. close() {
  248. this.show = false;
  249. // console.log('close');
  250. },
  251. open() {},
  252. },
  253. };
  254. </script>
  255. <style lang="less" scoped>
  256. .tabbar {
  257. display: flex;
  258. align-items: center;
  259. justify-content: space-around;
  260. position: fixed;
  261. bottom: 0;
  262. width: 100vw;
  263. z-index: 1000;
  264. height: 81px;
  265. left: 0;
  266. padding: -2px 0 16px 0;
  267. .tabbarbg {
  268. position: absolute;
  269. left: 0;
  270. right: 0;
  271. bottom: 0;
  272. }
  273. .tabbarItem {
  274. text-align: center;
  275. width: 50px;
  276. font-weight: 400;
  277. font-size: 11px;
  278. color: #303030;
  279. line-height: 13px;
  280. text-align: center;
  281. position: relative;
  282. z-index: 1;
  283. .hightImg {
  284. position: absolute;
  285. z-index: 2;
  286. top: 0;
  287. left: -10px;
  288. }
  289. .aotoImg {
  290. position: relative;
  291. top: -5px;
  292. }
  293. }
  294. }
  295. .codeData {
  296. // background: url(https://4dscene.4dage.com/new4dkk/deng/static/img/pop2@2x.png) no-repeat cover;
  297. background: url(https://4dscene.4dage.com/new4dkk/deng/static/img/code1.png)
  298. 100% 100% no-repeat;
  299. background-size: 100% auto;
  300. width: calc(100vw - 108px);
  301. height: 490px;
  302. padding: 48px 52px 30px 36px;
  303. position: relative;
  304. .close {
  305. position: absolute;
  306. right: -0px;
  307. top: -0px;
  308. width: 42px;
  309. height: 42px;
  310. }
  311. .text {
  312. font-weight: 400;
  313. font-size: 24px;
  314. color: #d86332;
  315. line-height: 29px;
  316. position: relative;
  317. padding-bottom: 72px;
  318. .codeDataText {
  319. padding: 8px 0 16px 0;
  320. font-weight: 400;
  321. font-size: 14px;
  322. color: #b1967b;
  323. line-height: 18px;
  324. text-align: left;
  325. }
  326. .codeImg {
  327. text-align: right;
  328. width: 72px;
  329. height: 72px;
  330. float: right;
  331. }
  332. }
  333. .codebutList {
  334. text-align: center;
  335. text-align: center;
  336. position: absolute;
  337. bottom: -42px;
  338. width: 100%;
  339. left: 0;
  340. margin: 0 auto;
  341. .downText {
  342. .img {
  343. margin-right: 10px;
  344. font-weight: 400;
  345. font-size: 16px;
  346. color: #ffffff;
  347. line-height: 19px;
  348. text-align: center;
  349. }
  350. .tips {
  351. padding-top: 10px;
  352. font-weight: 400;
  353. font-size: 16px;
  354. color: #a49d94;
  355. line-height: 19px;
  356. text-align: center;
  357. }
  358. }
  359. .downButtom {
  360. .downButtomItem {
  361. width: 140px;
  362. height: 42px;
  363. background: url(https://4dscene.4dage.com/new4dkk/deng/static/img/btn01@2x.png)
  364. 100% 100% no-repeat;
  365. background-size: cover;
  366. font-weight: 400;
  367. font-size: 16px;
  368. color: #ffffff;
  369. line-height: 19px;
  370. font-style: normal;
  371. margin: 0 5px;
  372. line-height: 42px;
  373. text-align: center;
  374. }
  375. }
  376. }
  377. }
  378. </style>