diff --git a/README.md b/README.md index b48a247..fe530d7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # 使用说明 -## 安装步骤 +## 小程序安装步骤 - 先从私服上clone下来项目 - 下载uni的开发者工具 https://www.dcloud.io/hbuilderx.html - 登录微信开发者工具打开 菜单 > 设置 > 安全设置 勾选服务端口为开启 @@ -16,8 +16,7 @@ - 如需修改样式问题,请编辑.less的文件,请勿编辑.css的文件 ## 声明 -- 此阶段的uni项目app端只是可以运行界面,还无法进行正常的登录以及分享和支付操作 -- 小程序端暂时90%的功能及界面正常,相关代码后面兼容app时会做一些调整 +- app测试版已上,请通过 `https://www.pgyer.com/yRYf` 安装测试。 - 运行app项目ios需要安装xcode,安卓需要装安卓的sdk以及安卓模拟器,建议安卓安装genymotion https://www.genymotion.com/ 登录时可选择私人使用,勾选后无需付费 diff --git a/libs/login.js b/libs/login.js index c4fcebc..7a1c75a 100644 --- a/libs/login.js +++ b/libs/login.js @@ -13,13 +13,16 @@ import { } from "@/utils"; export default function toLogin(push, backUrl) { + // console.log('需要重新登录') store.commit("LOGOUT"); // 如果没有授权,走登录的接口重新授权 // 授权获取失败会跳转到授权的接口 + // console.log(store.getters.isAuthorization, '是否有登陆权限') if (store.getters.isAuthorization) { login() return } + // console.log(store.getters.isAuthorizationPage, '判断是不是登录页面或者授权页面') // 判断当前是不是已经在登录页面或者授权页,防止二次跳转 if (store.getters.isAuthorizationPage || getCurrentPageUrl() == '/pages/user/Login/index') { return diff --git a/libs/wechat.js b/libs/wechat.js index d018c69..929aabb 100644 --- a/libs/wechat.js +++ b/libs/wechat.js @@ -39,7 +39,9 @@ export const weappPay = (option) => { }, fail: (error) => { console.log(error) - uni.showToast({ title: JSON.stringify(error), icon: 'none', duration: 5000 }); + if (error.errMsg == 'requestPayment:fail cancel') { + uni.showToast({ title: '已取消支付', icon: 'none', duration: 5000 }); + } reject(error) } }) diff --git a/manifest.json b/manifest.json index c0f8b75..c2e2a3d 100644 --- a/manifest.json +++ b/manifest.json @@ -75,6 +75,13 @@ } }, "ad" : {} + }, + "splashscreen" : { + "ios" : { + "iphone" : { + "portrait-896h@3x" : "/Users/piao/Downloads/意(1)/1242+2688.png" + } + } } } }, diff --git a/pages/order/Logistics/index.vue b/pages/order/Logistics/index.vue index 365889d..b6bf2ee 100644 --- a/pages/order/Logistics/index.vue +++ b/pages/order/Logistics/index.vue @@ -1,381 +1,397 @@ diff --git a/pages/order/OrderDetails/index.vue b/pages/order/OrderDetails/index.vue index 076459a..6eea309 100644 --- a/pages/order/OrderDetails/index.vue +++ b/pages/order/OrderDetails/index.vue @@ -542,8 +542,6 @@ export default { } }, goBack() { - const history = this.app.history, - last = history[history.length - 1] || {}; if (last.name === "MyOrder") return this.$yrouter.back(); else return this.$yrouter.replace({ diff --git a/pages/order/OrderSubmission/index.vue b/pages/order/OrderSubmission/index.vue index b151b14..41223ae 100644 --- a/pages/order/OrderSubmission/index.vue +++ b/pages/order/OrderSubmission/index.vue @@ -90,8 +90,8 @@ - 备注信息 - + 备注信息(150字以内) + diff --git a/pages/shop/ShoppingCart/index.vue b/pages/shop/ShoppingCart/index.vue index 970cd91..ac593a1 100644 --- a/pages/shop/ShoppingCart/index.vue +++ b/pages/shop/ShoppingCart/index.vue @@ -1,110 +1,135 @@ diff --git a/pages/user/UserVip/index.vue b/pages/user/UserVip/index.vue index b8ed735..9498832 100644 --- a/pages/user/UserVip/index.vue +++ b/pages/user/UserVip/index.vue @@ -44,8 +44,7 @@ - {{ item.name - }} + {{ item.name}} {{ item.finish ? "已满足条件" : "未满足条件" }} @@ -165,7 +164,8 @@ export default { }, err => { uni.showToast({ - title: err.msg || err.response.data.msg|| err.response.data.message, + title: + err.msg || err.response.data.msg || err.response.data.message, icon: "none", duration: 2000 }); @@ -182,7 +182,8 @@ export default { }, err => { uni.showToast({ - title: err.msg || err.response.data.msg|| err.response.data.message, + title: + err.msg || err.response.data.msg || err.response.data.message, icon: "none", duration: 2000 }); diff --git a/pages/user/signIn/Sign/index.vue b/pages/user/signIn/Sign/index.vue index 4907ca6..bcc879e 100644 --- a/pages/user/signIn/Sign/index.vue +++ b/pages/user/signIn/Sign/index.vue @@ -101,6 +101,7 @@ }; }, mounted: function() { + uni.showLoading({ title: "加载中", mask: true }); this.signUser(); this.signConfig(); this.getSignList(); @@ -129,6 +130,7 @@ postSignUser({ sign: 1 }).then(res => { + uni.hideLoading(); res.data.integral = parseInt(res.data.integral); var sumSginDay = res.data.sumSignDay; that.userInfo = res.data; @@ -180,4 +182,4 @@ } } }; - + diff --git a/utils/index.js b/utils/index.js index 06e65b4..f286d4c 100644 --- a/utils/index.js +++ b/utils/index.js @@ -114,17 +114,19 @@ export const replaceLogin = (msg) => { uni.hideLoading(); if (msg) { uni.showToast({ - title: msg, + title: '重新登录中...', icon: 'none', duration: 2000 }); } - // 这里代表已经失去登录状态以及401强制退出登录了 + // 这里代表已经失去登录状态以及401强制推出登录了 store.commit('LOGOUT') + console.log('如果是微信小程序,跳转到授权页', Vue.prototype.$deviceType, msg) if (Vue.prototype.$deviceType == 'routine') { // 如果是微信小程序,跳转到授权页 login({ fail: () => { + console.log('如果是微信小程序,跳转到授权页') replace({ path: '/pages/authorization/index', query: { @@ -176,6 +178,10 @@ export const authorize = (authorizeStr) => { resolve('获取授权成功') }, fail() { + switchTab({ + path: '/pages/home/index', + // query + }); reject('获取授权失败') } }) @@ -252,13 +258,14 @@ export const login = (option) => { export const handleGetUserInfo = () => { getUser().then(res => { + console.log('获取用户信息') store.dispatch('setUserInfo', res.data) var pages = getCurrentPages() //获取加载的页面 var currentPage = pages[pages.length - 1] //获取当前页面的对象 let url = "/pages/home/index" let query = {} - + console.log('currentPage') if (currentPage) { // 获取到最后一个页面 if ( @@ -278,16 +285,21 @@ export const handleGetUserInfo = () => { } } } + console.log(url) if (url == '/pages/home/index' || url == '/pages/shop/GoodsClass/index' || url == '/pages/shop/ShoppingCart/index' || url == '/pages/user/User/index') { switchTab({ path: `${url}`, query }); } else { - push({ - path: `${url}`, - query - }) + switchTab({ + path: '/pages/home/index', + // query + }); + // push({ + // path: `${url}`, + // query + // }) } }) } diff --git a/utils/request.js b/utils/request.js index 135aa21..78f837e 100644 --- a/utils/request.js +++ b/utils/request.js @@ -10,10 +10,12 @@ fly.config.baseURL = VUE_APP_API_URL fly.interceptors.response.use( response => { + console.log(response) // 定时刷新access-token return response; }, error => { + console.log(error) if (error.toString() == 'Error: Network Error') { toLogin(); return Promise.reject({ msg: "未登录", toLogin: true }); @@ -47,18 +49,15 @@ function baseRequest(options) { // 提示错误信息 return Promise.reject({ msg: "未登录", toLogin: true }); } -console.log(options) // 结构请求需要的参数 const { url, params, data, login, ...option } = options // 发起请求 return fly.request(url, params || data, { ...option - }).then(res => { - console.log(res) + }).then(res => { const data = res.data || {}; if (res.status !== 200) { - return Promise.reject({ msg: "请求失败", res, data }); } if ([410000, 410001, 410002].indexOf(data.status) !== -1) {