From 4dbe755fa5e2bec43dc76a2a97617bffbf9f90f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=98=8A=E5=A4=A9?= <442384644@qq.com> Date: Fri, 28 Oct 2022 17:59:25 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E6=A8=A1=E7=89=88=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E3=80=91=E6=9B=B4=E6=96=B0=E7=94=A8=E6=88=B7=E7=AB=AF=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E6=BA=90=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- template/uni-app/App.vue | 137 +- template/uni-app/config/app.js | 2 +- template/uni-app/libs/routine.js | 1 - template/uni-app/libs/wechat.js | 6 +- template/uni-app/main.js | 182 +- template/uni-app/manifest.json | 10 +- template/uni-app/pages.json | 2 +- .../activity/goods_bargain_details/index.vue | 5 - .../activity/goods_seckill_details/index.vue | 6 +- .../pages/activity/presell_details/index.vue | 7 - .../components/uni-calendar/uni-calendar.vue | 22 +- .../uni-app/pages/admin/orderDetail/index.vue | 4 +- .../uni-app/pages/admin/orderList/index.vue | 8 +- template/uni-app/pages/auth/index.vue | 1 + .../pages/goods/order_confirm/index.vue | 10 +- .../pages/goods/order_details/index.vue | 4345 +++++++++-------- .../uni-app/pages/goods_cate/goods_cate1.vue | 937 ++-- .../uni-app/pages/goods_details/index.vue | 7 - .../index/diy/components/headerSerch.vue | 2 +- .../index/diy/components/liveBroadcast.vue | 4 +- template/uni-app/pages/index/index.vue | 187 +- .../visualization/components/headerSerch.vue | 2 +- .../index/visualization/components/menus.vue | 2 +- .../visualization/components/newGoods.vue | 4 +- .../visualization/components/popular.vue | 4 +- .../visualization/components/promotion.vue | 4 +- .../visualization/components/recommend.vue | 4 +- .../visualization/components/scrollBox.vue | 6 +- .../visualization/components/swiperBg.vue | 594 +-- .../pages/order_addcart/order_addcart.vue | 2751 +++++------ .../points_mall/integral_goods_details.vue | 4 - template/uni-app/pages/user/index.vue | 8 +- .../components/login_mobile/routine_phone.vue | 2 +- template/uni-app/pages/users/login/index.vue | 1 + .../pages/users/user_address_list/index.vue | 955 ++-- .../uni-app/pages/users/user_info/index.vue | 29 +- .../uni-app/pages/users/user_money/index.vue | 908 ++-- .../pages/users/wechat_login/index.vue | 23 +- template/uni-app/store/modules/app.js | 192 +- template/uni-app/utils/index.js | 333 +- template/uni-app/utils/lang.js | 9 +- 41 files changed, 5901 insertions(+), 5819 deletions(-) diff --git a/template/uni-app/App.vue b/template/uni-app/App.vue index 8b91effc7..7c34e574b 100644 --- a/template/uni-app/App.vue +++ b/template/uni-app/App.vue @@ -81,6 +81,44 @@ } } }, + onShow() { + const queryData = uni.getEnterOptionsSync() // uni-app版本 3.5.1+ 支持 + if (queryData.query.spread) { + this.$Cache.set('spread', queryData.query.spread); + this.globalData.spid = queryData.query.spread; + this.globalData.pid = queryData.query.spread; + silenceBindingSpread(this.globalData) + } + if (queryData.query.spid) { + this.$Cache.set('spread', queryData.query.spid); + this.globalData.spid = queryData.query.spid; + this.globalData.pid = queryData.query.spid; + silenceBindingSpread(this.globalData) + } + // #ifdef MP + if (queryData.query.scene) { + switch (queryData.scene) { + //扫描小程序码 + case 1047: + this.globalData.code = queryData.query.scene; + break; + //长按图片识别小程序码 + case 1048: + this.globalData.code = queryData.query.scene; + break; + //手机相册选取小程序码 + case 1049: + this.globalData.code = queryData.query.scene; + break; + //直接进入小程序 + case 1001: + this.globalData.spid = queryData.query.scene; + break; + } + silenceBindingSpread(this.globalData) + } + // #endif + }, async onLaunch(option) { let that = this; colorChange('color_change').then(res => { @@ -113,25 +151,14 @@ break } }); - console.log(Cache.has('localeJson', true)) - if (!Cache.has('localeJson', true)) { + if (!Cache.has('localeSet')) { getLangJson().then(res => { - Cache.set('localeJson', res.data, 600); - // uni.setStorageSync('localeJson', res.data) + Cache.set('locale', Object.keys(res.data)[0]) + uni.setStorageSync('localeJson', res.data); + Cache.set('localeSet', true, 600) // 语言类型缓存时间 }) } - if (option.query.spread) { - that.$Cache.set('spread', option.query.spread); - that.globalData.spid = option.query.spread; - that.globalData.pid = option.query.spread; - silenceBindingSpread() - } - if (option.query.spid) { - that.$Cache.set('spread', option.query.spid); - that.globalData.spid = option.query.spid; - that.globalData.pid = option.query.spid; - // silenceBindingSpread() - } + // #ifdef APP-PLUS || H5 uni.getSystemInfo({ success: function(res) { @@ -155,53 +182,43 @@ ); return false; } - if (option.query.hasOwnProperty('scene')) { - switch (option.scene) { - //扫描小程序码 - case 1047: - let val = that.$util.getUrlParams(decodeURIComponent(option.query.scene)); - that.globalData.code = val.pid === undefined ? val : val.pid; - break; - //长按图片识别小程序码 - case 1048: - that.globalData.code = option.query.scene; - break; - //手机相册选取小程序码 - case 1049: - that.globalData.code = option.query.scene; - break; - //直接进入小程序 - case 1001: - that.globalData.spid = option.query.scene; - break; - } - } const updateManager = wx.getUpdateManager(); - - updateManager.onCheckForUpdate(function(res) { - // 请求完新版本信息的回调 - }); - - updateManager.onUpdateReady(function() { - wx.showModal({ - title: '更新提示', - content: '新版本已经准备好,是否重启应用?', - success: function(res) { - if (res.confirm) { - // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启 - updateManager.applyUpdate(); - } + const startParamObj = wx.getEnterOptionsSync(); + if (wx.canIUse('getUpdateManager') && startParamObj.scene != 1154) { + const updateManager = wx.getUpdateManager() + console.log(updateManager); + updateManager.onCheckForUpdate(function(res) { + // 请求完新版本信息的回调 + // console.log(res.hasUpdate) + if (res.hasUpdate) { + updateManager.onUpdateFailed(function() { + return that.Tips({ + title: '新版本下载失败' + }); + }); + updateManager.onUpdateReady(function() { + wx.showModal({ + title: '更新提示', + content: '新版本已经下载好,是否重启当前应用?', + success(res) { + if (res.confirm) { + updateManager.applyUpdate() + } + } + }) + }) + updateManager.onUpdateFailed(function() { + wx.showModal({ + title: '发现新版本', + content: '请删除当前小程序,重启搜索打开...', + }) + }) } - }); - }); - - updateManager.onUpdateFailed(function() { - return that.Tips({ - title: '新版本下载失败' - }); - }); + }) + } // #endif + // getShopConfig().then(res => { // this.$store.commit('SETPHONESTATUS', res.data.status); // }); @@ -215,7 +232,7 @@ let menuButtonInfo = uni.getMenuButtonBoundingClientRect(); that.globalData.navH = menuButtonInfo.top * 2 + menuButtonInfo.height / 2; const version = uni.getSystemInfoSync().SDKVersion - if (Routine.compareVersion(version, '2.21.2') >= 0) { + if (Routine.compareVersion(version, '2.21.3') >= 0) { console.log(version) that.$Cache.set('MP_VERSION_ISNEW', true) } else { diff --git a/template/uni-app/config/app.js b/template/uni-app/config/app.js index a6db7540e..a4a218d54 100644 --- a/template/uni-app/config/app.js +++ b/template/uni-app/config/app.js @@ -9,7 +9,7 @@ module.exports = { // #ifdef H5 //H5接口是浏览器地址,非单独部署不用修改 HTTP_REQUEST_URL: window.location.protocol + "//" + window.location.host, - // #endif + // #endif // 以下配置在不做二开的前提下,不需要做任何的修改 HEADER: { diff --git a/template/uni-app/libs/routine.js b/template/uni-app/libs/routine.js index ed338068a..3f88cc46b 100644 --- a/template/uni-app/libs/routine.js +++ b/template/uni-app/libs/routine.js @@ -153,7 +153,6 @@ class Routine { uni.login({ provider: provider, success(res) { - console.log(res, '22222') if (res.code) Cache.set(STATE_R_KEY, res.code, 10800); return resolve(res.code); }, diff --git a/template/uni-app/libs/wechat.js b/template/uni-app/libs/wechat.js index 5f75ba7a6..85313b05a 100644 --- a/template/uni-app/libs/wechat.js +++ b/template/uni-app/libs/wechat.js @@ -48,9 +48,9 @@ class AuthWechat { } signLink() { - if (typeof window.entryUrl === 'undefined' || window.entryUrl === '') { - window.entryUrl = document.location.href - } + // if (typeof window.entryUrl === 'undefined' || window.entryUrl === '') { + // window.entryUrl = encodeURI(window.location.href) + // } return /(Android)/i.test(navigator.userAgent) ? document.location.href : window.entryUrl; } diff --git a/template/uni-app/main.js b/template/uni-app/main.js index 9c2c25436..65a96ea35 100644 --- a/template/uni-app/main.js +++ b/template/uni-app/main.js @@ -1,87 +1,95 @@ -// +---------------------------------------------------------------------- -// | CRMEB [ CRMEB赋能开发者,助力企业发展 ] -// +---------------------------------------------------------------------- -// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved. -// +---------------------------------------------------------------------- -// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 -// +---------------------------------------------------------------------- -// | Author: CRMEB Team -// +---------------------------------------------------------------------- - -import Vue from 'vue' -import App from './App' -import store from './store' -import Cache from './utils/cache' -import util from 'utils/util' -import configs from './config/app.js' -import socket from './libs/new_chat.js' -import i18n from './utils/lang.js'; -Vue.prototype.$util = util; -Vue.prototype.$config = configs; -Vue.prototype.$Cache = Cache; -Vue.prototype.$eventHub = new Vue(); -Vue.prototype.$socket = new socket(); -Vue.config.productionTip = false -import pageLoading from './components/pageLoading.vue' -import skeleton from './components/skeleton/index.vue' - -Vue.component('skeleton', skeleton) -Vue.component('pageLoading',pageLoading) - - -// #ifdef H5 - - -import { parseQuery } from "./utils"; -import Auth from './libs/wechat'; -import { SPREAD } from './config/cache'; -Vue.prototype.$wechat = Auth; - - - -let cookieName = "VCONSOLE", - query = parseQuery(), - urlSpread = query["spread"], - vconsole = query[cookieName.toLowerCase()], - md5Crmeb = "b14d1e9baeced9bb7525ab19ee35f2d2", //CRMEB MD5 加密开启vconsole模式 - md5UnCrmeb = "3dca2162c4e101b7656793a1af20295c"; //UN_CREMB MD5 加密关闭vconsole模式 - -if (urlSpread !== undefined) { - var spread = Cache.get(SPREAD); - urlSpread = parseInt(urlSpread); - if (!Number.isNaN(urlSpread) && spread !== urlSpread) { - Cache.set("spread", urlSpread || 0); - } else if (spread === 0 || typeof spread !== "number") { - Cache.set("spread", urlSpread || 0); - } -} - -if (vconsole !== undefined) { - if (vconsole === md5UnCrmeb && Cache.has(cookieName)) - Cache.clear(cookieName); -} else vconsole = Cache.get(cookieName); - -import VConsole from './pages/extension/components/vconsole.min.js' - -if (vconsole !== undefined && vconsole === md5Crmeb) { - Cache.set(cookieName, md5Crmeb, 3600); - let vConsole = new VConsole(); -} - -// let snsapiBase = 'snsapi_base'; -// Auth.isWeixin() && Auth.oAuth(snsapiBase); - - -//全局路由前置守卫 -// #endif - -App.mpType = 'app' - - -const app = new Vue({ - ...App, - store, - Cache, - i18n, -}) -app.$mount(); \ No newline at end of file +// +---------------------------------------------------------------------- +// | CRMEB [ CRMEB赋能开发者,助力企业发展 ] +// +---------------------------------------------------------------------- +// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved. +// +---------------------------------------------------------------------- +// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 +// +---------------------------------------------------------------------- +// | Author: CRMEB Team +// +---------------------------------------------------------------------- + +import Vue from 'vue' +import App from './App' +import store from './store' +import Cache from './utils/cache' +import util from 'utils/util' +import configs from './config/app.js' +import socket from './libs/new_chat.js' +import i18n from './utils/lang.js'; +Vue.prototype.$util = util; +Vue.prototype.$config = configs; +Vue.prototype.$Cache = Cache; +Vue.prototype.$eventHub = new Vue(); +Vue.prototype.$socket = new socket(); +Vue.config.productionTip = false +import pageLoading from './components/pageLoading.vue' +import skeleton from './components/skeleton/index.vue' + +Vue.component('skeleton', skeleton) +Vue.component('pageLoading', pageLoading) + + +// #ifdef H5 + + +import { + parseQuery +} from "./utils"; +import Auth from './libs/wechat'; +import { + SPREAD +} from './config/cache'; +Vue.prototype.$wechat = Auth; + + + +let cookieName = "VCONSOLE", + query = parseQuery(), + urlSpread = query["spread"], + vconsole = query[cookieName.toLowerCase()], + md5Crmeb = "b14d1e9baeced9bb7525ab19ee35f2d2", //CRMEB MD5 加密开启vconsole模式 + md5UnCrmeb = "3dca2162c4e101b7656793a1af20295c"; //UN_CREMB MD5 加密关闭vconsole模式 + +if (urlSpread !== undefined) { + var spread = Cache.get(SPREAD); + urlSpread = parseInt(urlSpread); + if (!Number.isNaN(urlSpread) && spread !== urlSpread) { + Cache.set("spread", urlSpread || 0); + } else if (spread === 0 || typeof spread !== "number") { + Cache.set("spread", urlSpread || 0); + } +} + +if (vconsole !== undefined) { + if (vconsole === md5UnCrmeb && Cache.has(cookieName)) + Cache.clear(cookieName); +} else vconsole = Cache.get(cookieName); + +import VConsole from './pages/extension/components/vconsole.min.js' + +if (vconsole !== undefined && vconsole === md5Crmeb) { + Cache.set(cookieName, md5Crmeb, 3600); + let vConsole = new VConsole(); +} + +// let snsapiBase = 'snsapi_base'; +// Auth.isWeixin() && Auth.oAuth(snsapiBase); + +// 记录进入app时的url +if (typeof window.entryUrl === 'undefined' || window.entryUrl === '') { + window.entryUrl = location.href +} + +//全局路由前置守卫 +// #endif + +App.mpType = 'app' + + +const app = new Vue({ + ...App, + store, + Cache, + i18n, +}) +app.$mount(); diff --git a/template/uni-app/manifest.json b/template/uni-app/manifest.json index 5192b8206..31fdae590 100644 --- a/template/uni-app/manifest.json +++ b/template/uni-app/manifest.json @@ -167,7 +167,7 @@ "quickapp" : {}, /* 小程序特有相关 */ "mp-weixin" : { - "appid" : "wx3b82801238ca1b57", + "appid" : "wx1234567890", "setting" : { "urlCheck" : false, "minified" : true, @@ -179,7 +179,13 @@ "desc" : "你的位置信息将用于和门店的距离长度" } }, - "usingComponents" : true + "usingComponents" : true, + "requiredPrivateInfos" : [ + "getLocation", + "onLocationChange", + "startLocationUpdateBackground", + "chooseAddress" + ] }, "mp-alipay" : { "usingComponents" : true diff --git a/template/uni-app/pages.json b/template/uni-app/pages.json index 35224dde7..ca4be113a 100644 --- a/template/uni-app/pages.json +++ b/template/uni-app/pages.json @@ -944,7 +944,7 @@ ], "plugins": { "live-player-plugin": { - "version": "1.3.2", + "version": "1.3.5", "provider": "wx2b03c6e691cd7370" } } diff --git a/template/uni-app/pages/activity/goods_bargain_details/index.vue b/template/uni-app/pages/activity/goods_bargain_details/index.vue index ad3eb8e3f..d56ce1ace 100644 --- a/template/uni-app/pages/activity/goods_bargain_details/index.vue +++ b/template/uni-app/pages/activity/goods_bargain_details/index.vue @@ -271,9 +271,6 @@ import countDown from '@/components/countDown'; import home from '@/components/home'; import parser from '@/components/jyf-parser/jyf-parser'; - import { - silenceBindingSpread - } from '@/utils'; // #ifdef APP-PLUS import { TOKENNAME, @@ -479,8 +476,6 @@ `/pages/activity/goods_bargain_details/index?id=${options.id}&bargain=${this.bargainUid}`); toLogin(); } - - this.isLogin && silenceBindingSpread(); uni.setNavigationBarTitle({ title: this.$t(`砍价详情`) }); diff --git a/template/uni-app/pages/activity/goods_seckill_details/index.vue b/template/uni-app/pages/activity/goods_seckill_details/index.vue index 546f97377..6b1a5daba 100644 --- a/template/uni-app/pages/activity/goods_seckill_details/index.vue +++ b/template/uni-app/pages/activity/goods_seckill_details/index.vue @@ -47,7 +47,7 @@ {{$t(`¥`)}}{{storeInfo.price}} {{$t(`onwards`)}} + v-if="attribute.productAttr.length && (attribute.productAttr.length?attribute.productAttr[0].attr_values.length:0) > 1">{{$t(`起`)}} {{$t(`¥`)}}{{storeInfo.ot_price}} @@ -256,9 +256,6 @@ import { toLogin } from '@/libs/login.js'; - import { - silenceBindingSpread - } from "@/utils"; import { getUserInfo } from '@/api/user.js'; @@ -403,7 +400,6 @@ //res.windowHeight:获取整个窗口高度为px,*2为rpx;98为头部占据的高度; }, }); - this.isLogin && silenceBindingSpread(); // #ifdef MP this.navH = app.globalData.navHeight; // #endif diff --git a/template/uni-app/pages/activity/presell_details/index.vue b/template/uni-app/pages/activity/presell_details/index.vue index 46c0c1920..225bb5fbf 100644 --- a/template/uni-app/pages/activity/presell_details/index.vue +++ b/template/uni-app/pages/activity/presell_details/index.vue @@ -265,9 +265,6 @@ import userEvaluation from '@/components/userEvaluation'; import shareRedPackets from '@/components/shareRedPackets'; import kefuIcon from '@/components/kefuIcon'; - import { - silenceBindingSpread - } from '@/utils'; import parser from '@/components/jyf-parser/jyf-parser'; import ClipboardJS from '@/plugin/clipboard/clipboard.js'; // #ifdef MP @@ -444,10 +441,6 @@ if (options.spid) app.globalData.spid = options.spid; // #endif that.getGoodsDetails(); - // that.getCouponList(0); - //#ifdef H5 - that.isLogin && silenceBindingSpread(); - //#endif }, onReady: function() { this.$nextTick(function() { diff --git a/template/uni-app/pages/admin/components/uni-calendar/uni-calendar.vue b/template/uni-app/pages/admin/components/uni-calendar/uni-calendar.vue index 912cfa92e..9bab41c50 100644 --- a/template/uni-app/pages/admin/components/uni-calendar/uni-calendar.vue +++ b/template/uni-app/pages/admin/components/uni-calendar/uni-calendar.vue @@ -4,21 +4,21 @@ - {{$t(`cansel`)}} + {{$t(`取消`)}} - {{$t(`confirm`)}} + {{$t(`确定`)}} - {{ (nowDate.year||'') +$t(`year`)+( nowDate.month||'') +$t(`month`)}} + {{ (nowDate.year||'') +$t(`年`)+( nowDate.month||'') +$t(`月`)}} - {{$t(`back_today`)}} + {{$t(`回到当天`)}} @@ -26,25 +26,25 @@ - {{$t(`sun`)}} + {{$t(`天`)}} - {{$t(`mon`)}} + {{$t(`一`)}} - {{$t(`tue`)}} + {{$t(`二`)}} - {{$t(`wed`)}} + {{$t(`三`)}} - {{$t(`thu`)}} + {{$t(`四`)}} - {{$t(`fri`)}} + {{$t(`五`)}} - {{$t(`sat`)}} + {{$t(`六`)}} diff --git a/template/uni-app/pages/admin/orderDetail/index.vue b/template/uni-app/pages/admin/orderDetail/index.vue index 625607018..b4011574d 100644 --- a/template/uni-app/pages/admin/orderDetail/index.vue +++ b/template/uni-app/pages/admin/orderDetail/index.vue @@ -714,9 +714,8 @@ color: #333; border-radius: 3rpx; border: 1px solid #666; - padding: 0rpx 15rpx; + padding: 2rpx 15rpx; margin-left: 24rpx; - height: 40rpx; } .order-details .wrapper .actualPay { @@ -866,7 +865,6 @@ border: 1px solid #666; padding: 0px 7px; margin-left: 12px; - height: 20px; } .upload .pictrue { diff --git a/template/uni-app/pages/admin/orderList/index.vue b/template/uni-app/pages/admin/orderList/index.vue index f3b0ebec4..deaff8aff 100644 --- a/template/uni-app/pages/admin/orderList/index.vue +++ b/template/uni-app/pages/admin/orderList/index.vue @@ -370,12 +370,16 @@ - - + + diff --git a/template/uni-app/pages/goods_cate/goods_cate1.vue b/template/uni-app/pages/goods_cate/goods_cate1.vue index 9cffbd37b..7a37174d0 100644 --- a/template/uni-app/pages/goods_cate/goods_cate1.vue +++ b/template/uni-app/pages/goods_cate/goods_cate1.vue @@ -1,469 +1,470 @@ - - - - - + diff --git a/template/uni-app/pages/goods_details/index.vue b/template/uni-app/pages/goods_details/index.vue index e385ff173..c56509257 100644 --- a/template/uni-app/pages/goods_details/index.vue +++ b/template/uni-app/pages/goods_details/index.vue @@ -462,7 +462,6 @@ import kefuIcon from "@/components/kefuIcon"; import menuIcon from "@/components/menuIcon.vue"; import { - silenceBindingSpread, updateURLParameter } from "@/utils"; import ClipboardJS from "@/plugin/clipboard/clipboard.js"; @@ -663,14 +662,8 @@ } else { that.id = options.id; } - //记录推广人uid - if (options.spid) app.globalData.spid = options.spid; // #endif that.getGoodsDetails(); - // that.getCouponList(0); - //#ifdef H5 - that.isLogin && silenceBindingSpread(); - //#endif }, onReady: function() { this.isNodes++; diff --git a/template/uni-app/pages/index/diy/components/headerSerch.vue b/template/uni-app/pages/index/diy/components/headerSerch.vue index 9186b5f63..ebcb68755 100644 --- a/template/uni-app/pages/index/diy/components/headerSerch.vue +++ b/template/uni-app/pages/index/diy/components/headerSerch.vue @@ -9,7 +9,7 @@ - {{$t(`搜索商品名称`)}} + {{$t(`搜索商品`)}} diff --git a/template/uni-app/pages/index/diy/components/liveBroadcast.vue b/template/uni-app/pages/index/diy/components/liveBroadcast.vue index 10a140f0e..d1be7bdba 100644 --- a/template/uni-app/pages/index/diy/components/liveBroadcast.vue +++ b/template/uni-app/pages/index/diy/components/liveBroadcast.vue @@ -162,10 +162,10 @@ listStyle: this.dataConfig.listStyle.type, mbConfig: this.dataConfig.mbConfig.val, liveList: [], - custom_params:'' + custom_params:'', // bg:this.dataConfig.bg.color[0].item, // boxShadow: this.dataConfig.boxShadow.color[0].item, - // limit:this.dataConfig.limit.val + limit:this.dataConfig.limit.val }; }, created() {}, diff --git a/template/uni-app/pages/index/index.vue b/template/uni-app/pages/index/index.vue index 4a12ed5d0..3283c2522 100644 --- a/template/uni-app/pages/index/index.vue +++ b/template/uni-app/pages/index/index.vue @@ -1,92 +1,97 @@ - - - - - diff --git a/template/uni-app/pages/index/visualization/components/headerSerch.vue b/template/uni-app/pages/index/visualization/components/headerSerch.vue index f9b461ef5..270117d2f 100644 --- a/template/uni-app/pages/index/visualization/components/headerSerch.vue +++ b/template/uni-app/pages/index/visualization/components/headerSerch.vue @@ -4,7 +4,7 @@ - {{item.info[0].value}} + {{$t(item.info[0].value)}} diff --git a/template/uni-app/pages/index/visualization/components/newGoods.vue b/template/uni-app/pages/index/visualization/components/newGoods.vue index 7f612e30a..53076db0f 100644 --- a/template/uni-app/pages/index/visualization/components/newGoods.vue +++ b/template/uni-app/pages/index/visualization/components/newGoods.vue @@ -7,10 +7,10 @@ - {{titleInfo[0].val}} + {{$t(titleInfo[0].val)}} - {{titleInfo[1].val}} + {{$t(titleInfo[1].val)}} {{$t(`更多`)}} diff --git a/template/uni-app/pages/index/visualization/components/popular.vue b/template/uni-app/pages/index/visualization/components/popular.vue index da2b9c2dd..19e455e87 100644 --- a/template/uni-app/pages/index/visualization/components/popular.vue +++ b/template/uni-app/pages/index/visualization/components/popular.vue @@ -17,10 +17,10 @@ - {{titleInfo[0].val}} + {{$t(titleInfo[0].val)}} - {{titleInfo[1].val}} + {{$t(titleInfo[1].val)}} {{$t(`更多`)}} diff --git a/template/uni-app/pages/index/visualization/components/promotion.vue b/template/uni-app/pages/index/visualization/components/promotion.vue index b4c998a04..3cd105e21 100644 --- a/template/uni-app/pages/index/visualization/components/promotion.vue +++ b/template/uni-app/pages/index/visualization/components/promotion.vue @@ -5,8 +5,8 @@ - {{titleInfo[0].val}} - {{titleInfo[1].val}} + {{$t(titleInfo[0].val)}} + {{$t(titleInfo[1].val)}} {{$t(`更多`)}} diff --git a/template/uni-app/pages/index/visualization/components/recommend.vue b/template/uni-app/pages/index/visualization/components/recommend.vue index 310af39c7..a157825f8 100644 --- a/template/uni-app/pages/index/visualization/components/recommend.vue +++ b/template/uni-app/pages/index/visualization/components/recommend.vue @@ -6,9 +6,9 @@ - {{titleInfo[0].val}} + {{$t(titleInfo[0].val)}} - {{titleInfo[1].val}} + {{$t(titleInfo[1].val)}} {{$t(`更多`)}} diff --git a/template/uni-app/pages/index/visualization/components/scrollBox.vue b/template/uni-app/pages/index/visualization/components/scrollBox.vue index 6b56bc2a2..4c0ce6315 100644 --- a/template/uni-app/pages/index/visualization/components/scrollBox.vue +++ b/template/uni-app/pages/index/visualization/components/scrollBox.vue @@ -3,8 +3,8 @@ - {{titleInfo[0].val}} - {{titleInfo[1].val}} + {{$t(titleInfo[0].val)}} + {{$t(titleInfo[1].val)}} {{$t(`更多`)}} @@ -17,7 +17,7 @@ - {{item.cate_name}} + {{$t(item.cate_name)}} diff --git a/template/uni-app/pages/index/visualization/components/swiperBg.vue b/template/uni-app/pages/index/visualization/components/swiperBg.vue index a3bb37818..2c1092ab5 100644 --- a/template/uni-app/pages/index/visualization/components/swiperBg.vue +++ b/template/uni-app/pages/index/visualization/components/swiperBg.vue @@ -1,295 +1,301 @@ - - - - - diff --git a/template/uni-app/pages/order_addcart/order_addcart.vue b/template/uni-app/pages/order_addcart/order_addcart.vue index 1cc29ec3b..e2507d246 100644 --- a/template/uni-app/pages/order_addcart/order_addcart.vue +++ b/template/uni-app/pages/order_addcart/order_addcart.vue @@ -1,1372 +1,1381 @@ - - - - - diff --git a/template/uni-app/pages/points_mall/integral_goods_details.vue b/template/uni-app/pages/points_mall/integral_goods_details.vue index 5eb7571d3..3e6c080b5 100644 --- a/template/uni-app/pages/points_mall/integral_goods_details.vue +++ b/template/uni-app/pages/points_mall/integral_goods_details.vue @@ -142,9 +142,6 @@ import { toLogin } from '@/libs/login.js'; - import { - silenceBindingSpread - } from "@/utils"; import { getUserInfo } from '@/api/user.js'; @@ -270,7 +267,6 @@ //res.windowHeight:获取整个窗口高度为px,*2为rpx;98为头部占据的高度; }, }); - this.isLogin && silenceBindingSpread(); // #ifdef H5 that.navH = 96; // #endif diff --git a/template/uni-app/pages/user/index.vue b/template/uni-app/pages/user/index.vue index c7d234154..d8b67d36b 100644 --- a/template/uni-app/pages/user/index.vue +++ b/template/uni-app/pages/user/index.vue @@ -20,16 +20,10 @@ - - - - diff --git a/template/uni-app/pages/users/components/login_mobile/routine_phone.vue b/template/uni-app/pages/users/components/login_mobile/routine_phone.vue index 3886ddb6a..5f509c607 100644 --- a/template/uni-app/pages/users/components/login_mobile/routine_phone.vue +++ b/template/uni-app/pages/users/components/login_mobile/routine_phone.vue @@ -55,7 +55,7 @@ // 小程序获取手机号码 getphonenumber(e) { uni.showLoading({ - title: this.$t(`加载中`) + title: this.$t(`正在登录中`) }); Routine.getCode() .then(code => { diff --git a/template/uni-app/pages/users/login/index.vue b/template/uni-app/pages/users/login/index.vue index 253e391e5..d7c7fec44 100644 --- a/template/uni-app/pages/users/login/index.vue +++ b/template/uni-app/pages/users/login/index.vue @@ -563,6 +563,7 @@ captchaVerification: data.captchaVerification }) .then(res => { + this.sendCode() that.$util.Tips({ title: res.msg }); diff --git a/template/uni-app/pages/users/user_address_list/index.vue b/template/uni-app/pages/users/user_address_list/index.vue index 92605d06e..73c335442 100644 --- a/template/uni-app/pages/users/user_address_list/index.vue +++ b/template/uni-app/pages/users/user_address_list/index.vue @@ -1,476 +1,485 @@ - - - - - diff --git a/template/uni-app/pages/users/user_info/index.vue b/template/uni-app/pages/users/user_info/index.vue index 44ab774ab..f65cc3da1 100644 --- a/template/uni-app/pages/users/user_info/index.vue +++ b/template/uni-app/pages/users/user_info/index.vue @@ -43,7 +43,7 @@ {{$t(`昵称`)}} - + @@ -254,12 +254,15 @@ }, bindPickerChange(e, item) { this.setIndex = e.detail.value - uni.setStorageSync('locale', this.array[this.setIndex].value); + Cache.set('locale', this.array[this.setIndex].value) getLangJson().then(res => { - Cache.set('localeJson', res.data, 600) - this.$i18n.locale = this.array[this.setIndex].value; - this.$i18n.setLocaleMessage(this.array[this.setIndex].value, res.data[this - .array[this.setIndex].value]); + uni.setStorageSync('localeJson', res.data); + this.$i18n.setLocaleMessage(this.array[this.setIndex].value, res.data[this.array[ + this.setIndex].value]); + this.$nextTick(e => { + this.$i18n.locale = this.array[this.setIndex].value; + }) + Cache.set('localeSet', true, 600) }) }, @@ -463,7 +466,6 @@ const { avatarUrl } = e.detail - console.log(avatarUrl) this.$util.uploadImgs('upload/image', avatarUrl, (res) => { this.userInfo.avatar = res.data.url }, (err) => { @@ -611,7 +613,7 @@ padding: 30rpx 30rpx 30rpx 0; border-bottom: 1rpx solid #f2f2f2; margin-left: 30rpx; - font-size: 32rpx; + font-size: 28rpx; color: #282828; } @@ -636,17 +638,20 @@ } .personal-data .list .item .input { - width: 415rpx; + max-width: 400rpx; text-align: right; - color: #868686; + color: #868686; + .icon-suozi{ + margin-left: 10rpx; + } } .personal-data .list .item .input .id { - width: 365rpx; + // width: 180rpx; } .personal-data .list .item .input .iconfont { - font-size: 35rpx; + font-size: 24rpx; } .personal-data .modifyBnt { diff --git a/template/uni-app/pages/users/user_money/index.vue b/template/uni-app/pages/users/user_money/index.vue index 4111bf6df..63d4cd5ca 100644 --- a/template/uni-app/pages/users/user_money/index.vue +++ b/template/uni-app/pages/users/user_money/index.vue @@ -1,453 +1,457 @@ - - - - - diff --git a/template/uni-app/pages/users/wechat_login/index.vue b/template/uni-app/pages/users/wechat_login/index.vue index 800bf3b2f..9edbf5c45 100644 --- a/template/uni-app/pages/users/wechat_login/index.vue +++ b/template/uni-app/pages/users/wechat_login/index.vue @@ -216,17 +216,28 @@ userLogin() { Routine.getCode() .then(code => { + uni.showLoading({ + title: this.$t(`正在登录中`) + }); authLogin({ code, spread_spid: app.globalData.spid, spread_code: app.globalData.code }).then(res => { - let time = res.data.expires_time - this.$Cache.time(); - this.$store.commit('LOGIN', { - token: res.data.token, - time: time - }); - this.getUserInfo() + if (res.data.key !== undefined && res.data.key) { + uni.hideLoading(); + this.authKey = res.data.key; + this.isPhoneBox = true; + } else { + uni.hideLoading(); + let time = res.data.expires_time - this.$Cache.time(); + this.$store.commit('LOGIN', { + token: res.data.token, + time: time + }); + this.getUserInfo() + } + }) }) .catch(err => { diff --git a/template/uni-app/store/modules/app.js b/template/uni-app/store/modules/app.js index 9446b018d..e13978f6a 100644 --- a/template/uni-app/store/modules/app.js +++ b/template/uni-app/store/modules/app.js @@ -1,97 +1,97 @@ -// +---------------------------------------------------------------------- -// | CRMEB [ CRMEB赋能开发者,助力企业发展 ] -// +---------------------------------------------------------------------- -// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved. -// +---------------------------------------------------------------------- -// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 -// +---------------------------------------------------------------------- -// | Author: CRMEB Team -// +---------------------------------------------------------------------- - -import { - getUserInfo -} from "../../api/user.js"; -import { - LOGIN_STATUS, - UID -} from '../../config/cache'; -import Cache from '../../utils/cache'; -import { - USER_INFO -} from '../../config/cache'; - -const state = { - token: Cache.get(LOGIN_STATUS) || false, - backgroundColor: "#fff", - userInfo: {}, - uid: Cache.get(UID) || 0, - homeActive: false, - phoneStatus:true, - pageFooter:uni.getStorageSync('pageFoot') || {} -}; - -const mutations = { - SETPHONESTATUS(state,val){ - state.phoneStatus = val; - }, - LOGIN(state, opt) { - state.token = opt.token; - Cache.set(LOGIN_STATUS, opt.token, opt.time); - }, - SETUID(state,val){ - state.uid = val; - Cache.set(UID, val); - }, - UPDATE_LOGIN(state, token) { - state.token = token; - }, - LOGOUT(state) { - state.token = false; - state.uid = 0 - Cache.clear(LOGIN_STATUS); - Cache.clear(UID); - }, - BACKGROUND_COLOR(state, color) { - state.color = color; - document.body.style.backgroundColor = color; - }, - UPDATE_USERINFO(state, userInfo) { - state.userInfo = userInfo; - Cache.set(USER_INFO, userInfo); - }, - OPEN_HOME(state) { - state.homeActive = true; - }, - CLOSE_HOME(state) { - state.homeActive = false; - }, - FOOT_UPLOAD(state,data){ - state.pageFooter = data - } -}; - -const actions = { - USERINFO({ - state, - commit - }, force) { - if (state.userInfo !== null && !force) - return Promise.resolve(state.userInfo); - else - return new Promise(reslove => { - getUserInfo().then(res => { - commit("UPDATE_USERINFO", res.data); - Cache.set(USER_INFO, res.data); - reslove(res.data); - }); - }).catch(() => { - - }); - } -}; - -export default { - state, - mutations, - actions +// +---------------------------------------------------------------------- +// | CRMEB [ CRMEB赋能开发者,助力企业发展 ] +// +---------------------------------------------------------------------- +// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved. +// +---------------------------------------------------------------------- +// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 +// +---------------------------------------------------------------------- +// | Author: CRMEB Team +// +---------------------------------------------------------------------- + +import { + getUserInfo +} from "../../api/user.js"; +import { + LOGIN_STATUS, + UID, + USER_INFO +} from '../../config/cache'; +import Cache from '../../utils/cache'; + +const state = { + token: Cache.get(LOGIN_STATUS) || false, + backgroundColor: "#fff", + userInfo: {}, + uid: Cache.get(UID) || 0, + homeActive: false, + phoneStatus: true, + pageFooter: uni.getStorageSync('pageFoot') || {} +}; + +const mutations = { + SETPHONESTATUS(state, val) { + state.phoneStatus = val; + }, + LOGIN(state, opt) { + state.token = opt.token; + Cache.set(LOGIN_STATUS, opt.token, opt.time); + }, + SETUID(state, val) { + state.uid = val; + Cache.set(UID, val); + }, + UPDATE_LOGIN(state, token) { + state.token = token; + }, + LOGOUT(state) { + state.token = false; + state.uid = 0 + Cache.clear(LOGIN_STATUS); + Cache.clear(USER_INFO); + Cache.clear(UID); + Cache.clear('snsapiCode'); + }, + BACKGROUND_COLOR(state, color) { + state.color = color; + document.body.style.backgroundColor = color; + }, + UPDATE_USERINFO(state, userInfo) { + state.userInfo = userInfo; + Cache.set(USER_INFO, userInfo); + }, + OPEN_HOME(state) { + state.homeActive = true; + }, + CLOSE_HOME(state) { + state.homeActive = false; + }, + FOOT_UPLOAD(state, data) { + state.pageFooter = data + } +}; + +const actions = { + USERINFO({ + state, + commit + }, force) { + if (state.userInfo !== null && !force) + return Promise.resolve(state.userInfo); + else + return new Promise(reslove => { + getUserInfo().then(res => { + commit("UPDATE_USERINFO", res.data); + Cache.set(USER_INFO, res.data); + reslove(res.data); + }); + }).catch(() => { + + }); + } +}; + +export default { + state, + mutations, + actions }; diff --git a/template/uni-app/utils/index.js b/template/uni-app/utils/index.js index c23af8ea6..27f1bf5b1 100644 --- a/template/uni-app/utils/index.js +++ b/template/uni-app/utils/index.js @@ -1,168 +1,167 @@ -// +---------------------------------------------------------------------- -// | CRMEB [ CRMEB赋能开发者,助力企业发展 ] -// +---------------------------------------------------------------------- -// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved. -// +---------------------------------------------------------------------- -// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 -// +---------------------------------------------------------------------- -// | Author: CRMEB Team -// +---------------------------------------------------------------------- - -import { - spread -} from "@/api/user"; -import Cache from "@/utils/cache"; -import { - getCustomerType -} from '@/api/api.js' -import { - getWorkermanUrl -} from '@/api/kefu.js' -/** - * 绑定用户授权 - * @param {Object} puid - */ -export function silenceBindingSpread() { - - - //#ifdef H5 - let puid = Cache.get('spread'), - code = 0; - //#endif - - //#ifdef MP || APP-PLUS - let puid = getApp().globalData.spid, - code = getApp().globalData.code; - //#endif - - puid = parseInt(puid); - if (Number.isNaN(puid)) { - puid = 0; - } - if (puid) { - spread({ - puid, - code - }).then(res => { - //#ifdef H5 - Cache.clear('spread'); - //#endif - - //#ifdef MP || APP-PLUS - getApp().globalData.spid = 0; - getApp().globalData.code = 0; - //#endif - - }).catch(res => {}); - } -} - -export function isWeixin() { - return navigator.userAgent.toLowerCase().indexOf("micromessenger") !== -1; -} - -export function getCustomer(url) { - getCustomerType().then(res => { - let type = res.data.customer_type - if (type == '0') { - uni.navigateTo({ - url: url || '/pages/extension/customer_list/chat' - }) - } else if (type == '1') { - uni.makePhoneCall({ - phoneNumber: res.data.customer_phone //客服电话 - }); - } else { - // #ifdef APP-PLUS - plus.runtime.openURL(res.data.customer_url) - // #endif - // #ifdef H5 || MP - if (res.data.customer_url.indexOf('work.weixin.qq.com') > 0) { - // #ifdef H5 - return window.location.href = res.data.customer_url - // #endif - // #ifdef MP - uni.openCustomerServiceChat({ - extInfo: { - url: res.data.customer_url - }, - corpId: res.data.customer_corpId, - success(res) {}, - fail(err) { - uni.showToast({ - title: err.errMsg, - icon: 'none', - duration: 2000 - }); - } - }) - // #endif - } else { - uni.navigateTo({ - url: `/pages/annex/web_view/index?url=${res.data.customer_url}` - }); - } - // #endif - } - }) -} - - -export function parseQuery() { - const res = {}; - - const query = (location.href.split("?")[1] || "") - .trim() - .replace(/^(\?|#|&)/, ""); - - if (!query) { - return res; - } - - query.split("&").forEach(param => { - const parts = param.replace(/\+/g, " ").split("="); - const key = decodeURIComponent(parts.shift()); - const val = parts.length > 0 ? decodeURIComponent(parts.join("=")) : null; - - if (res[key] === undefined) { - res[key] = val; - } else if (Array.isArray(res[key])) { - res[key].push(val); - } else { - res[key] = [res[key], val]; - } - }); - - return res; -} -export function updateURLParameter(url, param, paramVal) { - var newAdditionalURL = ""; - var tempArray = url.split("?"); - var baseURL = tempArray[0]; - var additionalURL = tempArray[1]; - var temp = ""; - if (additionalURL) { - tempArray = additionalURL.split("&"); - for (let i = 0; i < tempArray.length; i++) { - if (tempArray[i].split('=')[0] != param) { - newAdditionalURL += temp + tempArray[i]; - temp = "&"; - } - } - } - - var rows_txt = temp + "" + param + "=" + paramVal; - return baseURL + "?" + newAdditionalURL + rows_txt; -} - -let VUE_APP_WS_URL = Cache.get('WORKERMAN_URL') || '' -getWorkermanUrl().then(res => { - Cache.set('WORKERMAN_URL', res.data.chat) - VUE_APP_WS_URL = res.data.chat; -}) - -export { - VUE_APP_WS_URL -} - +// +---------------------------------------------------------------------- +// | CRMEB [ CRMEB赋能开发者,助力企业发展 ] +// +---------------------------------------------------------------------- +// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved. +// +---------------------------------------------------------------------- +// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权 +// +---------------------------------------------------------------------- +// | Author: CRMEB Team +// +---------------------------------------------------------------------- + +import { + spread +} from "@/api/user"; +import Cache from "@/utils/cache"; +import { + getCustomerType +} from '@/api/api.js' +import { + getWorkermanUrl +} from '@/api/kefu.js' +import store from '@/store'; +/** + * 绑定用户授权 + * @param {Object} puid + */ +export function silenceBindingSpread(app) { + console.log(app) + //#ifdef H5 + let puid = Cache.get('spread'), + code = 0; + //#endif + + //#ifdef MP || APP-PLUS + let puid = app.spid, + code = app.code; + //#endif + + puid = parseInt(puid); + if (Number.isNaN(puid)) { + puid = 0; + } + if ((code || puid) && store.state.app.token) { + spread({ + puid, + code + }).then(res => { + //#ifdef H5 + Cache.clear('spread'); + //#endif + //#ifdef MP || APP-PLUS + app.spid = 0; + app.code = 0; + //#endif + + }).catch(res => {}); + } +} + +export function isWeixin() { + return navigator.userAgent.toLowerCase().indexOf("micromessenger") !== -1; +} + +export function getCustomer(url) { + getCustomerType().then(res => { + let type = res.data.customer_type + if (type == '0') { + uni.navigateTo({ + url: url || '/pages/extension/customer_list/chat' + }) + } else if (type == '1') { + uni.makePhoneCall({ + phoneNumber: res.data.customer_phone //客服电话 + }); + } else { + // #ifdef APP-PLUS + plus.runtime.openURL(res.data.customer_url) + // #endif + // #ifdef H5 || MP + if (res.data.customer_url.indexOf('work.weixin.qq.com') > 0) { + // #ifdef H5 + return window.location.href = res.data.customer_url + // #endif + // #ifdef MP + uni.openCustomerServiceChat({ + extInfo: { + url: res.data.customer_url + }, + corpId: res.data.customer_corpId, + success(res) {}, + fail(err) { + uni.showToast({ + title: err.errMsg, + icon: 'none', + duration: 2000 + }); + } + }) + // #endif + } else { + uni.navigateTo({ + url: `/pages/annex/web_view/index?url=${res.data.customer_url}` + }); + } + // #endif + } + }) +} + + +export function parseQuery() { + const res = {}; + + const query = (location.href.split("?")[1] || "") + .trim() + .replace(/^(\?|#|&)/, ""); + + if (!query) { + return res; + } + + query.split("&").forEach(param => { + const parts = param.replace(/\+/g, " ").split("="); + const key = decodeURIComponent(parts.shift()); + const val = parts.length > 0 ? decodeURIComponent(parts.join("=")) : null; + + if (res[key] === undefined) { + res[key] = val; + } else if (Array.isArray(res[key])) { + res[key].push(val); + } else { + res[key] = [res[key], val]; + } + }); + + return res; +} +export function updateURLParameter(url, param, paramVal) { + var newAdditionalURL = ""; + var tempArray = url.split("?"); + var baseURL = tempArray[0]; + var additionalURL = tempArray[1]; + var temp = ""; + if (additionalURL) { + tempArray = additionalURL.split("&"); + for (let i = 0; i < tempArray.length; i++) { + if (tempArray[i].split('=')[0] != param) { + newAdditionalURL += temp + tempArray[i]; + temp = "&"; + } + } + } + + var rows_txt = temp + "" + param + "=" + paramVal; + return baseURL + "?" + newAdditionalURL + rows_txt; +} + +let VUE_APP_WS_URL = Cache.get('WORKERMAN_URL') || '' +getWorkermanUrl().then(res => { + Cache.set('WORKERMAN_URL', res.data.chat) + VUE_APP_WS_URL = res.data.chat; +}) + +export { + VUE_APP_WS_URL +} + export default parseQuery; diff --git a/template/uni-app/utils/lang.js b/template/uni-app/utils/lang.js index 818b7304e..9b09d34ac 100644 --- a/template/uni-app/utils/lang.js +++ b/template/uni-app/utils/lang.js @@ -1,18 +1,19 @@ import Vue from 'vue'; import VueI18n from 'vue-i18n' - +import Cache from '@/utils/cache'; Vue.use(VueI18n) let lang = ''; // #ifdef MP || APP-PLUS -lang = uni.getStorageSync('locale') != '' ? uni.getStorageSync('locale') : 'zh-CN'; +lang = Cache.has('locale') ? Cache.get('locale') : 'zh-CN'; // #endif // #ifdef H5 -lang = uni.getStorageSync('locale') != '' ? uni.getStorageSync('locale') : navigator.language; +lang = Cache.has('locale') ? Cache.get('locale') : navigator.language; // #endif const i18n = new VueI18n({ - locale: lang ? lang : 'zh-CN', + locale: lang, + fallbackLocale: 'zh-CN', messages: uni.getStorageSync('localeJson') }) export default i18n