Browse Source

支付代码

master
unknown 7 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(config)
let token = vm.$store.state.user.vuex_loginInfo.accessToken
console.log(token)
if(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
module.exports = {
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/',//非代理地址
website: 'http://192.168.1.37',

12
manifest.json

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

4
pages.json

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

4
pages/indexEntry/enroll/enroll.vue

@ -238,7 +238,9 @@
uni.hideLoading()
},6000)
}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="pay">
<!-- <view class="h2">选择支付方式</view> -->
<view class="row border">
<!-- <view class="row border">
<view class="wxIcon">
<image src="@/static/images/carIcon/xfbIcon.png" mode=""></image>
</view>
<view class="text">支付宝</view>
<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 class="row">
<view class="wxIcon">
@ -37,7 +37,7 @@
</view>
<view class="text">微信</view>
<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>
</view>
</view>
@ -63,8 +63,34 @@
this.trainingApplyId = options.trainingApplyId
}
this.getStudentByPayment()
this.initWx()
},
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() {
const {data: res} = await getStudentByPayment({trainingApplyId: this.trainingApplyId})
this.$store.dispatch('getUserInfo')

5
pages/mineEntry/myAppointment/myAppointment.vue

@ -42,8 +42,8 @@
],
// 012退39
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}],
total: 20,
status: 'loading'
@ -72,6 +72,7 @@
},
changeNav(item) {
if(this.currentNav == item.id) return
this.currentNav = item.id
this.list = []
this.params.pageNo = 1

5
pages/mineEntry/myOrder/myOrder.vue

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

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

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

4
pages/tabbar/index/index.vue

@ -23,7 +23,7 @@
<!-- 海报 -->
<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"
field="content">
<swiper class="swiper-box" @change="change" :current="swiperDotIndex" >
@ -246,7 +246,7 @@
},
//
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
console.log(res)
},

11
pages/tabbar/mine/index.vue

@ -4,7 +4,7 @@
<!-- 用户信息 -->
<view class="userInfo">
<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 class="rightInfo" @click="topClick">
<view class="name-row">
@ -45,6 +45,11 @@
</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>
</template>
@ -53,6 +58,7 @@
export default {
data() {
return {
show: false,
ulData: [
{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'},
@ -70,6 +76,9 @@
]
}
},
onHide() {
if(this.show) this.show = false
},
methods: {
topClick() {
if(!this.vuex_userInfo.phone) {

18
store/modules/user.js

@ -177,14 +177,14 @@ function getCityInfo(resolve, reject, commit) {
let result = res.location
if(result.latitude===0) {
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 {
console.log('腾讯云经纬度')
console.log(result)
@ -202,7 +202,7 @@ function getCityInfo(resolve, reject, commit) {
})
}catch(e){
console.log('来到这是里了吗?')
console.log('来到这是里了吗?腾讯云经纬度了')
uni.getLocation({
// type: 'wgs84',
type: 'gcj02',

Loading…
Cancel
Save