Browse Source

程序上线测试

v1
前端-胡立永 5 months ago
parent
commit
eb866d675f
9 changed files with 104 additions and 36 deletions
  1. +2
    -1
      api/http.js
  2. +25
    -9
      components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue
  3. +3
    -3
      config.js
  4. +2
    -2
      manifest.json
  5. +33
    -3
      pages/center/center.vue
  6. +4
    -4
      pages/login/login.vue
  7. +4
    -2
      pages/login/wxUserInfo.vue
  8. +26
    -12
      pages/payment/payment.vue
  9. +5
    -0
      store/store.js

+ 2
- 1
api/http.js View File

@ -25,7 +25,8 @@ function http(uri, data, callback, method = 'GET', showLoading, title) {
} }
if(res.statusCode == 401 || if(res.statusCode == 401 ||
res.data.message == '操作失败,token非法无效!'){
res.data.message == '操作失败,token非法无效!' ||
res.data.message == '操作失败,用户不存在!'){
uni.removeStorageSync('token') uni.removeStorageSync('token')
console.error('登录过期'); console.error('登录过期');
uni.navigateTo({ uni.navigateTo({


+ 25
- 9
components/PrivacyAgreementPoup/PrivacyAgreementPoup.vue View File

@ -6,7 +6,7 @@
</view> </view>
<view class="content_pri"> <view class="content_pri">
<view class="text"> <view class="text">
欢迎来到xx加!我们根据最新的法律法规监管政策要求更新了用户协议隐私政策,请您认真阅读
欢迎来到车队佳!我们根据最新的法律法规监管政策要求更新了用户协议隐私政策,请您认真阅读
</view> </view>
</view> </view>
<view class="config"> <view class="config">
@ -14,18 +14,20 @@
<view class="content"> <view class="content">
<view style="display: flex;"> <view style="display: flex;">
<uv-checkbox size="30rpx" :name="1"></uv-checkbox> <uv-checkbox size="30rpx" :name="1"></uv-checkbox>
同意<text>xx加油隐私政策</text>
同意<text @click="goToPrivacy">车队佳油隐私政策</text>
</view> </view>
<view class=""> <view class="">
以及<text>用户协议</text>
以及<text @click="goToPrivacy">用户协议</text>
</view> </view>
</view> </view>
</uv-checkbox-group> </uv-checkbox-group>
</view> </view>
<view class="pri_btn"> <view class="pri_btn">
<!-- <button class="confuse_btn" @click="confusePrivacy">拒绝</button> --> <!-- <button class="confuse_btn" @click="confusePrivacy">拒绝</button> -->
<button class="confirm_btn" id="agree-btn" open-type="agreePrivacyAuthorization"
@agreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button>
<button
class="confirm_btn" id="agree-btn"
open-type="agreePrivacyAuthorization"
@agreeprivacyauthorization="handleAgreePrivacyAuthorization">同意</button>
</view> </view>
</view> </view>
</uv-popup> </uv-popup>
@ -40,6 +42,20 @@
checkboxValue : false checkboxValue : false
} }
}, },
mounted() {
if(wx.getPrivacySetting){
wx.getPrivacySetting({
success: res => {
console.log(res)
if (res.needAuthorization) {
//
this.init()
}
},
fail: () => {}
})
}
},
methods: { methods: {
// //
@ -74,10 +90,10 @@
// //
handleAgreePrivacyAuthorization() { handleAgreePrivacyAuthorization() {
// id // id
this.resolvePrivacyAuthorization({
buttonId: 'agree-btn',
event: 'agree'
})
// this.resolvePrivacyAuthorization({
// buttonId: 'agree-btn',
// event: 'agree'
// })
this.$refs.popup.close() this.$refs.popup.close()
} }
} }


+ 3
- 3
config.js View File

@ -7,17 +7,17 @@ import uvUI from '@/uni_modules/uv-ui-tools'
Vue.use(uvUI); Vue.use(uvUI);
// 当前环境 // 当前环境
const type = 'dev'
const type = 'prod'
// 环境配置 // 环境配置
const config = { const config = {
dev : { dev : {
// baseUrl : 'http://8.138.162.67:8000/a-notice-api', // baseUrl : 'http://8.138.162.67:8000/a-notice-api',
baseUrl : 'http://h5.xzaiyp.top/a-notice-api',
baseUrl : 'http://h5.xzaiyp.top/cheer-admin',
}, },
prod : { prod : {
baseUrl : 'http://admin.anqi.shop/a-notice-api',
baseUrl : 'https://cheer-admin.xzaiyp.top/cheer-admin',
} }
} }


+ 2
- 2
manifest.json View File

@ -1,6 +1,6 @@
{ {
"name" : "unapp模板", "name" : "unapp模板",
"appid" : "__UNI__07DB806",
"appid" : "__UNI__02A377E",
"description" : "", "description" : "",
"versionName" : "1.0.0", "versionName" : "1.0.0",
"versionCode" : "100", "versionCode" : "100",
@ -52,7 +52,7 @@
"quickapp" : {}, "quickapp" : {},
/* */ /* */
"mp-weixin" : { "mp-weixin" : {
"appid" : "wx3c24e397e3b132ea",
"appid" : "wxe337e285c449abfc",
"setting" : { "setting" : {
"urlCheck" : false "urlCheck" : false
}, },


+ 33
- 3
pages/center/center.vue View File

@ -2,7 +2,7 @@
<view class=""> <view class="">
<uni-nav-bar dark :fixed="true" background-color="#00aaff" :border="false" status-bar title="个人中心" /> <uni-nav-bar dark :fixed="true" background-color="#00aaff" :border="false" status-bar title="个人中心" />
<view class="content"> <view class="content">
<view class="topBox">
<!-- <view class="topBox">
<view class="users"> <view class="users">
<view class="u-top" v-if="userInfo.appletOpenid"> <view class="u-top" v-if="userInfo.appletOpenid">
<image class="img" :src="userInfo.headImage" mode="widthFix"></image> <image class="img" :src="userInfo.headImage" mode="widthFix"></image>
@ -10,7 +10,30 @@
{{ userInfo.nickName }} {{ userInfo.nickName }}
</view> </view>
</view> </view>
<view class="u-top" v-else>
<view class="u-top" v-else
@click="">
<image class="img"
src="https://img2.baidu.com/it/u=2953585264,744730101&fm=253&fmt=auto&app=138&f=JPEG?w=360&h=360"
mode="widthFix"></image>
<view class="tit">
登录 / 注册
</view>
</view>
</view>
</view> -->
<view class="topBox">
<view class="users">
<view class="u-top"
@click="$utils.navigateTo('/login/wxUserInfo')"
v-if="userInfo.appletOpenid">
<image class="img" :src="userInfo.headImage" mode="widthFix"></image>
<view class="tit">
{{ userInfo.nickName }}
</view>
</view>
<view class="u-top"
v-else
@click="$utils.navigateTo('/login/login')">
<image class="img" <image class="img"
src="https://img2.baidu.com/it/u=2953585264,744730101&fm=253&fmt=auto&app=138&f=JPEG?w=360&h=360" src="https://img2.baidu.com/it/u=2953585264,744730101&fm=253&fmt=auto&app=138&f=JPEG?w=360&h=360"
mode="widthFix"></image> mode="widthFix"></image>
@ -36,6 +59,7 @@
<view class="money-detail"> <view class="money-detail">
<view class="unie"></view> <view class="unie"></view>
<view class="number">{{ item.price }}</view> <view class="number">{{ item.price }}</view>
<view class="oldPrice">{{ item.oldPrice }}</view>
</view> </view>
</div> </div>
</view> </view>
@ -71,8 +95,8 @@
onShow() { onShow() {
if (uni.getStorageSync('token')) { if (uni.getStorageSync('token')) {
this.$store.commit('getUserInfo') this.$store.commit('getUserInfo')
this.getOrderList()
} }
this.getOrderList()
}, },
// //
onReachBottom() { onReachBottom() {
@ -219,6 +243,12 @@
align-items: center; align-items: center;
margin-top: 20rpx; margin-top: 20rpx;
} }
.oldPrice{
margin-left: 10rpx;
color: #757575;
text-decoration: line-through;
}
.money-detail .unit { .money-detail .unit {
font-size: 34rpx; font-size: 34rpx;


+ 4
- 4
pages/login/login.vue View File

@ -4,12 +4,12 @@
<!-- <image src="/static/image/login/logo.png" mode=""></image> --> <!-- <image src="/static/image/login/logo.png" mode=""></image> -->
</view> </view>
<view class="title"> <view class="title">
欢迎使用xx加
欢迎使用车队佳
</view> </view>
<view class="btn mt"> <view class="btn mt">
<view class="icon">
<!-- <image src="/static/image/login/wx.png" mode=""></image> -->
</view>
<!-- <view class="icon">
<image src="/static/image/login/wx.png" mode=""></image>
</view> -->
<view class="" <view class=""
@click="wxLogin"> @click="wxLogin">
微信授权登录 微信授权登录


+ 4
- 2
pages/login/wxUserInfo.vue View File

@ -1,7 +1,7 @@
<template> <template>
<view class="login"> <view class="login">
<view class="title"> <view class="title">
帧视界
车队佳油
</view> </view>
<view class="title"> <view class="title">
申请获取你的头像昵称 申请获取你的头像昵称
@ -76,7 +76,9 @@
self.$api('infoUpdateInfo', self.userInfo, res => { self.$api('infoUpdateInfo', self.userInfo, res => {
if (res.code == 200) { if (res.code == 200) {
uni.navigateBack(-1)
uni.switchTab({
url:'/pages/center/center'
})
} }
}) })
}) })


+ 26
- 12
pages/payment/payment.vue View File

@ -16,7 +16,7 @@
<uni-section title="输入金额" type="line" titleFontSize="34rpx"></uni-section> <uni-section title="输入金额" type="line" titleFontSize="34rpx"></uni-section>
<view class="money-input"> <view class="money-input">
<image src="/static/payment/money.png" mode="widthFix"></image> <image src="/static/payment/money.png" mode="widthFix"></image>
<input v-model="form.money" @focus="focus" placeholder="请输入加油金额" type="number" />
<input v-model="form.money" @focus="focus" placeholder="请输入加油金额" type="digit" />
</view> </view>
<view v-if="form.money" class="tip"> <view v-if="form.money" class="tip">
@ -65,7 +65,7 @@
money: '' money: ''
}, },
resolvePrivacyAuthorization: {}, resolvePrivacyAuthorization: {},
currentIndex: 0,
currentIndex: -1,
content: [{ content: [{
iconPath: '/static/payment/wedding-celebration.png', iconPath: '/static/payment/wedding-celebration.png',
text: '婚庆服务', text: '婚庆服务',
@ -79,14 +79,14 @@
} }
}, },
onShow() { onShow() {
if (wx.onNeedPrivacyAuthorization) {
console.log('onNeedPrivacyAuthorization');
wx.onNeedPrivacyAuthorization(resolve => {
console.log('onNeedPrivacyAuthorization');
this.resolvePrivacyAuthorization = resolve
this.$refs.showPrivacy.init(resolve)
})
}
// if (wx.onNeedPrivacyAuthorization) {
// console.log('onNeedPrivacyAuthorization');
// wx.onNeedPrivacyAuthorization(resolve => {
// console.log('onNeedPrivacyAuthorization');
// this.resolvePrivacyAuthorization = resolve
// this.$refs.showPrivacy.init(resolve)
// })
// }
// wx.getPrivacySetting({ // wx.getPrivacySetting({
// success: res => { // success: res => {
// console.log(res) // console.log(res)
@ -127,7 +127,21 @@
url: '/pages/login/login' url: '/pages/login/login'
}) })
} }
this.$api('createOrderPay', this.form, res => {
let money = (this.form.money *
(this.configList.preferential ?
this.configList.preferential.keyCentent
: 1)).toFixed(2)
// if(!money){
// uni.showToast({
// icon: 'none',
// title: ''
// })
// }
this.$api('createOrderPay', {
money
}, res => {
this.form.money = '' this.form.money = ''
if(res.code == 200){ if(res.code == 200){
uni.requestPayment({ uni.requestPayment({
@ -157,7 +171,7 @@
// title: '' // title: ''
// }); // });
} }
})
}, "订单创建中...")
}, },
// //


+ 5
- 0
store/store.js View File

@ -39,6 +39,9 @@ const store = new Vuex.Store({
}) })
}, },
login(state) { login(state) {
uni.showLoading({
title:"登录中..."
})
uni.login({ uni.login({
success(res) { success(res) {
console.log(res); console.log(res);
@ -48,6 +51,7 @@ const store = new Vuex.Store({
api('loginLogin', { api('loginLogin', {
code: res.code code: res.code
}, res => { }, res => {
uni.hideLoading()
if (res.code != 200) { if (res.code != 200) {
return return
} }
@ -69,6 +73,7 @@ const store = new Vuex.Store({
}, },
fail(err) { fail(err) {
console.error(err) console.error(err)
uni.hideLoading()
} }
}) })
}, },


Loading…
Cancel
Save