From 00677377ca2fe3fd2997b826bde78cdbc58c582e Mon Sep 17 00:00:00 2001 From: wenfp Date: Sat, 27 Nov 2021 16:49:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E4=B8=AA=E4=BA=BA=E4=B8=AD?= =?UTF-8?q?=E5=BF=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .prettierrc.json | 2 +- package.json | 1 + src/App.vue | 3 +- src/common/tmap.js | 1 - src/common/wechat-web.js | 9 ++++- src/config/index.js | 8 +++++ src/main.js | 2 ++ src/mixins/index.js | 17 +++++++++ src/pages/buddha-activity/index.vue | 4 +-- src/pages/user/approve/index.vue | 12 +++---- src/pages/user/certificate/index.vue | 40 +++++++++++++++------ src/pages/user/customer/index.vue | 34 ++++-------------- src/pages/user/index.vue | 4 ++- src/pages/user/temple-station/index.vue | 45 ++++++++++++++++++++---- src/pages/user/temple-station/review.vue | 6 ++-- src/router/index.js | 3 -- yarn.lock | 5 +++ 17 files changed, 131 insertions(+), 65 deletions(-) create mode 100644 src/config/index.js diff --git a/.prettierrc.json b/.prettierrc.json index 828a735..9c21868 100644 --- a/.prettierrc.json +++ b/.prettierrc.json @@ -1,5 +1,5 @@ { "tabWidth": 4, - "singleQuote": true, + "singleQuote": false, "printWidth": 200 } \ No newline at end of file diff --git a/package.json b/package.json index 388464f..be32010 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "lint": "vue-cli-service lint" }, "dependencies": { + "async-validator": "^4.0.7", "axios": "^0.24.0", "better-scroll": "^2.4.2", "core-js": "^3.6.5", diff --git a/src/App.vue b/src/App.vue index bd395d3..7296760 100644 --- a/src/App.vue +++ b/src/App.vue @@ -41,7 +41,8 @@ export default { '$route': { handler(val) { this.active = tabbar.map(v => v.name).indexOf(val.name).toString(); - } + }, + deep: true, } }, computed: { diff --git a/src/common/tmap.js b/src/common/tmap.js index 5ae3210..21b5f6d 100644 --- a/src/common/tmap.js +++ b/src/common/tmap.js @@ -20,7 +20,6 @@ module.exports = { const script = document.createElement('script'); script.src = `https://map.qq.com/api/gljs?v=${config.version}&key=${config.key}&${libraries}`; document.head.appendChild(script) - console.log(script) script.setAttribute('async', true) script.setAttribute('charset', 'utf-8') script.onload = () => { diff --git a/src/common/wechat-web.js b/src/common/wechat-web.js index b7e8aa3..79c26ac 100644 --- a/src/common/wechat-web.js +++ b/src/common/wechat-web.js @@ -91,5 +91,12 @@ function updateTimelineShareData(title = '', desc = '', link = '', imgUrl = '') }); } +function previewImage(current, urls){ + console.log(current, urls) + wechatInstance.previewImage({ + current, urls + }) +} -export { signToWechat, getLocation, requestPayment, openLocation, updateAppMessageShareData, updateTimelineShareData }; \ No newline at end of file + +export { signToWechat, getLocation, requestPayment, openLocation, updateAppMessageShareData, updateTimelineShareData, previewImage }; \ No newline at end of file diff --git a/src/config/index.js b/src/config/index.js new file mode 100644 index 0000000..6f593d7 --- /dev/null +++ b/src/config/index.js @@ -0,0 +1,8 @@ +export default { + qrcode: { + wechatAccount: 'https://wdx-temple.oss-cn-hangzhou.aliyuncs.com/uploads/common/temple_wechat.jpg' + }, + RegExp: { + mobile: /^[1](([3][0-9])|([4][5-9])|([5][0-3,5-9])|([6][5,6])|([7][0-8])|([8][0-9])|([9][1,8,9]))[0-9]{8}$/ + } +} \ No newline at end of file diff --git a/src/main.js b/src/main.js index d80a9e9..4e4b3ef 100644 --- a/src/main.js +++ b/src/main.js @@ -8,10 +8,12 @@ import '@/assets/js/flexable.js'; import './common/vant'; import './components/index' import 'swiper/css/swiper.css' +import config from './config'; Vue.mixin(globalMixin) Vue.config.productionTip = false Vue.prototype.$delay = delay; +Vue.prototype.$config = config; Vue.use(VueAwesomeSwiper) new Vue({ diff --git a/src/mixins/index.js b/src/mixins/index.js index a15a1d5..a4c1238 100644 --- a/src/mixins/index.js +++ b/src/mixins/index.js @@ -1,3 +1,5 @@ +import { Toast } from 'vant'; + export default { directives: { numberOnly: { @@ -10,6 +12,21 @@ export default { unbind: function(el) { el.removeEventListener('input', el.handler) } + }, + copy: { + bind(el, binding, vnode){ + console.log(el, binding, vnode) + + el.addEventListener('click', () => { + const input = document.createElement('textarea'); + input.value = binding.value; + document.body.appendChild(input) + input.select(); + document.execCommand('copy'); + document.body.removeChild(input) + Toast.success('复制成功') + }, false) + }, } }, methods: { diff --git a/src/pages/buddha-activity/index.vue b/src/pages/buddha-activity/index.vue index 26d32c1..c22a98e 100644 --- a/src/pages/buddha-activity/index.vue +++ b/src/pages/buddha-activity/index.vue @@ -1,7 +1,7 @@