Browse Source

支付代码

master
unknown 6 months ago
parent
commit
d1da05e797
  1. 1
      config/request.js
  2. 2
      config/site.config.js
  3. 12
      manifest.json
  4. 4
      pages.json
  5. 4
      pages/indexEntry/enroll/enroll.vue
  6. 36
      pages/indexEntry/enroll/payment/payment.vue
  7. 5
      pages/mineEntry/myAppointment/myAppointment.vue
  8. 5
      pages/mineEntry/myOrder/myOrder.vue
  9. 6
      pages/mineEntry/myOrder/voucher/voucher.vue
  10. 4
      pages/tabbar/index/index.vue
  11. 11
      pages/tabbar/mine/index.vue
  12. 18
      store/modules/user.js

1
config/request.js

@ -29,6 +29,7 @@ module.exports = (vm) => {
// console.log('--------------') // console.log('--------------')
// console.log(config) // console.log(config)
let token = vm.$store.state.user.vuex_loginInfo.accessToken let token = vm.$store.state.user.vuex_loginInfo.accessToken
console.log(token)
if(token) { if(token) {
config.header.Authorization = 'Bearer ' + token config.header.Authorization = 'Bearer ' + token
} }

2
config/site.config.js

@ -2,7 +2,7 @@ const VUE_APP_PLATFORM = process.env.VUE_APP_PLATFORM;
// localIp = false // localIp = false
module.exports = { module.exports = {
H5_API: VUE_APP_PLATFORM === 'h5' ? '/api' : '',//h5代理 H5_API: VUE_APP_PLATFORM === 'h5' ? '/api' : '',//h5代理
// WX_API: VUE_APP_PLATFORM === 'h5' ? '/' : 'http://192.168.1.37:8318/',//非代理地址
// WX_API: VUE_APP_PLATFORM === 'h5' ? '/' : 'http://192.168.1.38:8318/',//非代理地址
WX_API: VUE_APP_PLATFORM === 'h5' ? '/' : 'http://work.lyjppt.com:8099/',//非代理地址 WX_API: VUE_APP_PLATFORM === 'h5' ? '/' : 'http://work.lyjppt.com:8099/',//非代理地址
website: 'http://192.168.1.37', website: 'http://192.168.1.37',

12
manifest.json

@ -21,7 +21,8 @@
"Maps" : {}, "Maps" : {},
"Barcode" : {}, "Barcode" : {},
"Geolocation" : {}, "Geolocation" : {},
"VideoPlayer" : {}
"VideoPlayer" : {},
"Share" : {}
}, },
/* */ /* */
"distribute" : { "distribute" : {
@ -66,7 +67,12 @@
}, },
/* SDK */ /* SDK */
"sdkConfigs" : { "sdkConfigs" : {
"share" : {},
"share" : {
"weixin" : {
"appid" : "",
"UniversalLinks" : ""
}
},
"ad" : {}, "ad" : {},
"maps" : { "maps" : {
"amap" : { "amap" : {
@ -164,7 +170,7 @@
"disableHostCheck" : true, "disableHostCheck" : true,
"proxy" : { "proxy" : {
"/api" : { "/api" : {
"target" : "http://192.168.1.43:8318/",
"target" : "http://192.168.1.38:8318/",
// "target" : "http://192.168.1.36:48080/", // "target" : "http://192.168.1.36:48080/",
"changeOrigin" : true, "changeOrigin" : true,
"secure" : true, "secure" : true,

4
pages.json

@ -422,8 +422,8 @@
{ {
"path": "myOrder/voucher/voucher", "path": "myOrder/voucher/voucher",
"style": { "style": {
"navigationBarTitleText": "我的订单",
"navigationStyle": "custom",
"navigationBarTitleText": "培训缴费电子凭证",
// "navigationStyle": "custom",
"enablePullDownRefresh": true, "enablePullDownRefresh": true,
"backgroundTextStyle": "dark" "backgroundTextStyle": "dark"
} }

4
pages/indexEntry/enroll/enroll.vue

@ -238,7 +238,9 @@
uni.hideLoading() uni.hideLoading()
},6000) },6000)
}else if(response.code==2006) { }else if(response.code==2006) {
this.$u.toast('认证失败!请确定是本人后再重试')
_this.$u.toast('认证失败!请确定是本人后再重试')
}else {
_this.$u.toast('认证失败!')
} }
}); });
}, },

36
pages/indexEntry/enroll/payment/payment.vue

@ -21,15 +21,15 @@
<view class="card"> <view class="card">
<view class="pay"> <view class="pay">
<!-- <view class="h2">选择支付方式</view> --> <!-- <view class="h2">选择支付方式</view> -->
<view class="row border">
<!-- <view class="row border">
<view class="wxIcon"> <view class="wxIcon">
<image src="@/static/images/carIcon/xfbIcon.png" mode=""></image> <image src="@/static/images/carIcon/xfbIcon.png" mode=""></image>
</view> </view>
<view class="text">支付宝</view> <view class="text">支付宝</view>
<view class="icon"> <view class="icon">
<!-- <image src="@/static/images/index/noSelect.png.png" mode=""></image> -->
<image src="@/static/images/carIcon/isSelect.png" mode=""></image>
</view>
<!-- <image src="@/static/images/index/noSelect.png" mode=""></image> -->
<!-- <image src="@/static/images/carIcon/isSelect.png" mode=""></image>
</view> -->
</view> </view>
<view class="row"> <view class="row">
<view class="wxIcon"> <view class="wxIcon">
@ -37,7 +37,7 @@
</view> </view>
<view class="text">微信</view> <view class="text">微信</view>
<view class="icon"> <view class="icon">
<!-- <image src="@/static/images/index/noSelect.png.png" mode=""></image> -->
<!-- <image src="@/static/images/index/noSelect.png" mode=""></image> -->
<image src="@/static/images/carIcon/isSelect.png" mode=""></image> <image src="@/static/images/carIcon/isSelect.png" mode=""></image>
</view> </view>
</view> </view>
@ -63,8 +63,34 @@
this.trainingApplyId = options.trainingApplyId this.trainingApplyId = options.trainingApplyId
} }
this.getStudentByPayment() this.getStudentByPayment()
this.initWx()
}, },
methods: { methods: {
initWx() {
// #ifdef APP-PLUS
plus.share.getServices((s) => {
var shares = {};
for (var i = 0; i < s.length; i++) {
var t = s[i];
console.log("...........", t);
shares[t.id] = t;
}
var sweixin = shares['weixin'];
this.sweixin = sweixin
}, function(e) {
console.log("获取分享服务列表失败:" + e.message);
});
// #endif
},
wxPay() {
// #ifdef APP-PLUS
this.sweixin ? this.sweixin.launchMiniProgram({
path: '/pages/payment/payment?tokenCode=' + this.payInfo.tokenCode, // pages/index/index
type: 0, // 0- 1- 2- 0
id: 'gh_012fd4bda1c2' //id
}) : plus.nativeUI.alert('当前环境不支持微信操作!');
// #endif
},
async getStudentByPayment() { async getStudentByPayment() {
const {data: res} = await getStudentByPayment({trainingApplyId: this.trainingApplyId}) const {data: res} = await getStudentByPayment({trainingApplyId: this.trainingApplyId})
this.$store.dispatch('getUserInfo') this.$store.dispatch('getUserInfo')

5
pages/mineEntry/myAppointment/myAppointment.vue

@ -42,8 +42,8 @@
], ],
// 012退39 // 012退39
currentTab: 2, currentTab: 2,
currentNav: 0,
params: { "pageNo": 1, "pageSize": 10, "keyWord": "", "status": '0',studentId: '', keyWord: ''},
currentNav: -1,
params: { "pageNo": 1, "pageSize": 10, "keyWord": "", "status": '',studentId: '', keyWord: ''},
list: [{id: 1}], list: [{id: 1}],
total: 20, total: 20,
status: 'loading' status: 'loading'
@ -72,6 +72,7 @@
}, },
changeNav(item) { changeNav(item) {
if(this.currentNav == item.id) return
this.currentNav = item.id this.currentNav = item.id
this.list = [] this.list = []
this.params.pageNo = 1 this.params.pageNo = 1

5
pages/mineEntry/myOrder/myOrder.vue

@ -105,7 +105,10 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.pageBg {
width: 100vw;
overflow: hidden;
}
.card { .card {
padding: 0 24rpx; padding: 0 24rpx;
margin-bottom: 20rpx; margin-bottom: 20rpx;

6
pages/mineEntry/myOrder/voucher/voucher.vue

@ -44,11 +44,17 @@
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.pageBgImg {
width: 100vw;
height: 100vh;
overflow-x: hidden;
}
.imgBox { .imgBox {
// transform: translateY(200px); // transform: translateY(200px);
transform: translateX(50px); transform: translateX(50px);
transform: rotate(90deg); transform: rotate(90deg);
width: 100%; width: 100%;
image { image {
margin-top: 500rpx; margin-top: 500rpx;
transform: scale(2); transform: scale(2);

4
pages/tabbar/index/index.vue

@ -23,7 +23,7 @@
<!-- 海报 --> <!-- 海报 -->
<view class="pad"> <view class="pad">
<uni-swiper-dot class="uni-swiper-dot-box bannerCon" @clickItem=clickItem :info="swiperInfo" v-if="swiperInfo.length"
<uni-swiper-dot class="uni-swiper-dot-box bannerCon" :info="swiperInfo" v-if="swiperInfo.length"
:current="current" :mode="mode" :dots-styles="dotsStyles" :current="current" :mode="mode" :dots-styles="dotsStyles"
field="content"> field="content">
<swiper class="swiper-box" @change="change" :current="swiperDotIndex" > <swiper class="swiper-box" @change="change" :current="swiperDotIndex" >
@ -246,7 +246,7 @@
}, },
// //
async getRecommendList() { async getRecommendList() {
const {data: res} = await getRecommendList({pageNo:1,pageSize: 20, lat: this.vuex_cityInfo.lat||'', lng: this.vuex_cityInfo.lng||''})
const {data: res} = await getRecommendList({pageNo:1,pageSize: 20, })
this.coachList = res this.coachList = res
console.log(res) console.log(res)
}, },

11
pages/tabbar/mine/index.vue

@ -4,7 +4,7 @@
<!-- 用户信息 --> <!-- 用户信息 -->
<view class="userInfo"> <view class="userInfo">
<view class="avatar"> <view class="avatar">
<image :src="vuex_userInfo.photoPath" mode="widthFix" v-if="vuex_userInfo.photoPath"></image>
<image :src="vuex_userInfo.photoPath" mode="aspectFill" v-if="vuex_userInfo.photoPath" @click="show=true"></image>
</view> </view>
<view class="rightInfo" @click="topClick"> <view class="rightInfo" @click="topClick">
<view class="name-row"> <view class="name-row">
@ -45,6 +45,11 @@
</view> </view>
</view> </view>
<u-popup :show="show" mode="center" @close="show=false" :closeable="true">
<view style="width: 90vw;">
<image :src="vuex_userInfo.photoPath" mode="widthFix" ></image>
</view>
</u-popup>
</view> </view>
</template> </template>
@ -53,6 +58,7 @@
export default { export default {
data() { data() {
return { return {
show: false,
ulData: [ ulData: [
{name: '学车进度', icon: require('@/static/images/mineIcon/emtryIcon (4).png'),url: '/pages/mineEntry/carLearProgress/carLearProgress'}, {name: '学车进度', icon: require('@/static/images/mineIcon/emtryIcon (4).png'),url: '/pages/mineEntry/carLearProgress/carLearProgress'},
{name: '我的预约', icon: require('@/static/images/mineIcon/emtryIcon (1).png'),url: '/pages/mineEntry/myAppointment/myAppointment'}, {name: '我的预约', icon: require('@/static/images/mineIcon/emtryIcon (1).png'),url: '/pages/mineEntry/myAppointment/myAppointment'},
@ -70,6 +76,9 @@
] ]
} }
}, },
onHide() {
if(this.show) this.show = false
},
methods: { methods: {
topClick() { topClick() {
if(!this.vuex_userInfo.phone) { if(!this.vuex_userInfo.phone) {

18
store/modules/user.js

@ -177,14 +177,14 @@ function getCityInfo(resolve, reject, commit) {
let result = res.location let result = res.location
if(result.latitude===0) { if(result.latitude===0) {
console.log('gogogo来了吗?') console.log('gogogo来了吗?')
uni.getLocation({
type: 'wgs84',
type: 'gcj02',
success: function(res) {
console.log('只为弹出权限当前位置的经度:' + res.longitude);
// console.log('当前位置的纬度:' + res);
},
})
// uni.getLocation({
// type: 'wgs84',
// type: 'gcj02',
// success: function(res) {
// console.log('只为弹出权限当前位置的经度:' + res.longitude);
// // console.log('当前位置的纬度:' + res);
// },
// })
}else { }else {
console.log('腾讯云经纬度') console.log('腾讯云经纬度')
console.log(result) console.log(result)
@ -202,7 +202,7 @@ function getCityInfo(resolve, reject, commit) {
}) })
}catch(e){ }catch(e){
console.log('来到这是里了吗?')
console.log('来到这是里了吗?腾讯云经纬度了')
uni.getLocation({ uni.getLocation({
// type: 'wgs84', // type: 'wgs84',
type: 'gcj02', type: 'gcj02',

Loading…
Cancel
Save