1.修改问题 新增扫码进入银联入口

master
杨杰 3 years ago
parent 8377c5d683
commit 052d264d6e
  1. 8
      high-unionPay/Utils/Api.js
  2. 3
      high-unionPay/Utils/Request.js
  3. 99
      high-unionPay/pages.json
  4. 18
      high-unionPay/pages/goods/externalCoupon/externalCoupon.vue
  5. 15
      high-unionPay/pages/goods/goods-list/goods-list.vue
  6. 2360
      high-unionPay/pages/tabBar/home/home.vue
  7. 1614
      high-unionPay/pages/tabBar/user/user.vue
  8. 20
      high-unionPay/pages/unionPay/unionPay-entrance/unionPay-entrance.vue
  9. 87
      high-unionPay/pages/userLogin/userLogin.vue

@ -186,9 +186,13 @@ export const paygetOrderById = params => {
return POST('GET', `${base}/outRechargeOrder/getOrderById`, params).then(res => res.data); return POST('GET', `${base}/outRechargeOrder/getOrderById`, params).then(res => res.data);
} }
//获取设置用户参数 //获取设置用户参数
export const getUserParam = params => { export const getCacheParam = params => {
return POST('GET', `${base}/highUser/getUserParam`, params).then(res => res.data); return POST('GET', `${base}/highUser/getCacheParam`, params).then(res => res.data);
} }
export const delCacheParam = params => {
return POST('GET', `${base}/highUser/delCacheParam`, params).then(res => res.data);
}
/** /**
* 工会卡 * 工会卡
*/ */

@ -12,7 +12,6 @@ function request(method, url, data) {
'Authorization': app.globalData.token 'Authorization': app.globalData.token
}, //有的时候这里不一定是 token 还可能是 Authorization }, //有的时候这里不一定是 token 还可能是 Authorization
success(res) { success(res) {
resolve(res)
if (res.statusCode === 401 || res.data.return_code == 102014 || res.data.return_code == if (res.statusCode === 401 || res.data.return_code == 102014 || res.data.return_code ==
104001) { 104001) {
app.globalData.userInfo = ''; app.globalData.userInfo = '';
@ -37,6 +36,8 @@ function request(method, url, data) {
}, 800); }, 800);
} }
}) })
}else{
resolve(res)
} }
}, },
fail(err) { fail(err) {

@ -1,6 +1,24 @@
{ {
"pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages "pages": [ //pageshttps://uniapp.dcloud.io/collocation/pages
{ {
"path": "pages/tabBar/home/home",
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "嗨加油",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"onReachBottomDistance": 50,
"app-plus": {
"titleNView": false, //
"softinputNavBar": "none",
"subNVues": [{
"id": "homeTitleNvue", //
"path": "pages/tabBar/home/subNvue/homeTitleNvue", //
"type": "navigationBar"
}]
}
}
},{
"path" : "pages/unionPay/unionPay-entrance/unionPay-entrance", "path" : "pages/unionPay/unionPay-entrance/unionPay-entrance",
"style" : "style" :
{ {
@ -22,24 +40,6 @@
"enablePullDownRefresh": false "enablePullDownRefresh": false
} }
},{
"path": "pages/tabBar/home/home",
"style": {
"navigationBarTextStyle": "white",
"navigationBarTitleText": "首页",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"onReachBottomDistance": 50,
"app-plus": {
"titleNView": false, //
"softinputNavBar": "none",
"subNVues": [{
"id": "homeTitleNvue", //
"path": "pages/tabBar/home/subNvue/homeTitleNvue", //
"type": "navigationBar"
}]
}
}
}, { }, {
"path": "pages/user/bindingCardList/bindingCardList", "path": "pages/user/bindingCardList/bindingCardList",
"style": { "style": {
@ -161,7 +161,7 @@
"backgroundColorTop": "#0083f5", "backgroundColorTop": "#0083f5",
"navigationBarTextStyle": "white", "navigationBarTextStyle": "white",
"app-plus": { "app-plus": {
// "titleNView": false, // "titleNView": false, //
"subNVues": [{ "subNVues": [{
"id": "userTitleNvue", // "id": "userTitleNvue", //
"path": "pages/tabBar/user/subNvue/userTitleNvue", // "path": "pages/tabBar/user/subNvue/userTitleNvue", //
@ -310,8 +310,8 @@
"path": "pages/user/order_list/order_list", "path": "pages/user/order_list/order_list",
"style": { "style": {
"navigationBarTitleText": "我的订单", "navigationBarTitleText": "我的订单",
"navigationBarBackgroundColor": "#f8f8f8", "navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#f3f3f3", "backgroundColorTop": "#0083f5",
"backgroundColorBottom": "#ffffff" "backgroundColorBottom": "#ffffff"
} }
}, { }, {
@ -470,7 +470,11 @@
"path": "pages/userLogin/userLogin", "path": "pages/userLogin/userLogin",
"style": { "style": {
"navigationBarTitleText": "嗨加油", "navigationBarTitleText": "嗨加油",
"enablePullDownRefresh": false "enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"navigationBarTextStyle": "white"
} }
}, { }, {
@ -554,31 +558,30 @@
"backgroundColor": "#ffffff", "backgroundColor": "#ffffff",
"backgroundColorTop": "#ffffff", "backgroundColorTop": "#ffffff",
"backgroundColorBottom": "#ffffff" "backgroundColorBottom": "#ffffff"
},
"tabBar": {
"color": "#333333",
"selectedColor": "#0083f5",
"borderStyle": "black",
"backgroundColor": "#ffffff",
"list": [{
"pagePath": "pages/tabBar/home/home",
"iconPath": "static/img/tabBar/home.png",
"selectedIconPath": "static/img/tabBar/home-on.png",
"text": "嗨加油"
},
// {
// "pagePath": "pages/tabBar/category/category",
// "iconPath": "static/img/tabBar/category.png",
// "selectedIconPath": "static/img/tabBar/category-on.png",
// "text": "导航"
// },
{
"pagePath": "pages/tabBar/user/user",
"iconPath": "static/img/tabBar/user.png",
"selectedIconPath": "static/img/tabBar/user-on.png",
"text": "我的"
}
]
} }
// "tabBar": {
// "color": "#333333",
// "selectedColor": "#0083f5",
// "borderStyle": "black",
// "backgroundColor": "#ffffff",
// "list": [{
// "pagePath": "pages/tabBar/home/home",
// "iconPath": "static/img/tabBar/home.png",
// "selectedIconPath": "static/img/tabBar/home-on.png",
// "text": "首页"
// },
// {
// "pagePath": "pages/tabBar/category/category",
// "iconPath": "static/img/tabBar/category.png",
// "selectedIconPath": "static/img/tabBar/category-on.png",
// "text": "导航"
// },
// {
// "pagePath": "pages/tabBar/user/user",
// "iconPath": "static/img/tabBar/user.png",
// "selectedIconPath": "static/img/tabBar/user-on.png",
// "text": "我的"
// }
// ]
// }
} }

@ -14,8 +14,7 @@
</view> </view>
</view> </view>
<view class="line1 mart15"></view> <view class="line1 mart15"></view>
<button class="coupne-btn width60w mart20 marb20" v-if="userInfo == 1" lang="zh_CN" open-type="getPhoneNumber" @getphonenumber="loginByPhone" <button class="coupne-btn width60w mart20 marb20" v-if="userInfo == 1" lang="zh_CN" @click="jumpres">点击领取</button>
withCredentials="true">点击领取</button>
<button class="coupne-btn width60w mart20 marb20" v-else @click="receiveDiscount">点击领取</button> <button class="coupne-btn width60w mart20 marb20" v-else @click="receiveDiscount">点击领取</button>
<view class="width90 mart10 fcor666">去使用</view> <view class="width90 mart10 fcor666">去使用</view>
<view v-if="minecoupones == '' " class="mart60 fotct font14 fcor666"> <view v-if="minecoupones == '' " class="mart60 fotct font14 fcor666">
@ -105,11 +104,12 @@
} }
}, },
onLoad(options) { onLoad(options) {
if (app.globalData.userInfo) { if (app.globalData.userInfo.phone) {
this.userInfo = 2; this.userInfo = 2;
} else { } else {
this.userInfo = 1; this.userInfo = 1;
} }
uni.login({ uni.login({
provider: 'weixin', provider: 'weixin',
success: function(loginRes) { success: function(loginRes) {
@ -158,7 +158,6 @@
}, },
// //
receiveDiscount() { receiveDiscount() {
uni.showLoading({ uni.showLoading({
title: '领取中...' title: '领取中...'
}) })
@ -166,15 +165,14 @@
codeId: this.couponsDetails.highDiscountAgentCode.id codeId: this.couponsDetails.highDiscountAgentCode.id
} }
receiveDiscount(params).then(res => { receiveDiscount(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') { if (res.return_code == '000000') {
uni.hideLoading();
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: res.return_data, title: res.return_data,
duration: 2000 duration: 2000
}) })
} else { }else{
uni.hideLoading();
uni.showToast({ uni.showToast({
icon: 'none', icon: 'none',
title: res.return_msg, title: res.return_msg,
@ -291,6 +289,12 @@
} }
}); });
}, },
//
jumpres() {
uni.navigateTo({
url:'../../login/register?id=2'
})
},
// //
toGoods(e) { toGoods(e) {
if (app.globalData.userInfo) { if (app.globalData.userInfo) {

@ -29,19 +29,19 @@
<view class="goodsxg font12 fotct">限购{{row.limitNumber}}</view> <view class="goodsxg font12 fotct">限购{{row.limitNumber}}</view>
<view class="info mart10"> <view class="info mart10">
<view class="price" v-if="typeId == 2"> <view class="price" v-if="row.payType != 1">
<image style="width: 15px;height: 15px;vertical-align: sub;" <image style="width: 15px;height: 15px;vertical-align: sub;"
src="../../../static/img/jfx.png"> src="../../../static/img/jfx.png">
</image> {{ row.discountPrice*100}} </image> {{ row.discountPrice*100}}
</view> </view>
<view class="price" v-if="typeId == 1"> <view class="price" v-else>
{{ row.discountPrice*100}} {{ row.discountPrice}}
</view> </view>
<!-- v-if="product.discountPrice !== product.salesPrice" --> <!-- v-if="product.discountPrice !== product.salesPrice" -->
<view class="slogan" v-if="row.discountPrice !== row.salesPrice"> <view class="slogan" v-if="row.discountPrice !== row.salesPrice">
<image v-if="typeId == 2" style="width: 15px;height: 15px;vertical-align: sub;" <image v-if="row.payType != 1" style="width: 15px;height: 15px;vertical-align: sub;"
src="../../../static/img/jfh.png"> src="../../../static/img/jfh.png">
</image> <text v-if="typeId == 1"></text>{{ row.salesPrice*100}} </image> <text v-else></text>{{ row.salesPrice*100}}
</view> </view>
</view> </view>
</view> </view>
@ -96,6 +96,11 @@
title: '积分列表' title: '积分列表'
}); });
} }
if (option.id == 3) {
uni.setNavigationBarTitle({
title: '商品列表'
});
}
this.getCouponListArea(); this.getCouponListArea();
this.getCmsContent(); this.getCmsContent();
}, },

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

@ -13,7 +13,7 @@
<script> <script>
import { import {
getUserParam getCacheParam
} from '../../../Utils/Api.js'; } from '../../../Utils/Api.js';
let app = getApp(); let app = getApp();
export default { export default {
@ -25,12 +25,11 @@
uni.getStorage({ uni.getStorage({
key: "user", key: "user",
success(e) { success(e) {
app.globalData.userInfo = e.data //token app.globalData.userInfo = e.data; //token
uni.getStorage({ uni.getStorage({
key: 'token', key: 'token',
success(e) { success(e) {
app.globalData.token = e.data; app.globalData.token = e.data;
that.getUserParam();
}, },
fail() { fail() {
uni.navigateTo({ uni.navigateTo({
@ -38,6 +37,13 @@
}) })
} }
}) })
if (!app.globalData.userInfo.phone) {
uni.navigateTo({
url: '../../userLogin/userLogin'
})
return;
}
that.getCacheParam();
}, },
fail: res => { fail: res => {
uni.navigateTo({ uni.navigateTo({
@ -45,11 +51,15 @@
}) })
} }
}) })
}, },
methods: { methods: {
//ID //ID
getUserParam() { getCacheParam() {
getUserParam().then(res => { let params = {
key: app.globalData.userInfo.phone
}
getCacheParam(params).then(res => {
if (res.return_code == '000000' && res.return_data) { if (res.return_code == '000000' && res.return_data) {
uni.navigateTo({ uni.navigateTo({
url: '../../goods/externalCoupon/externalCoupon?id=' + res.return_data url: '../../goods/externalCoupon/externalCoupon?id=' + res.return_data

@ -1,22 +1,17 @@
<template> <template>
<view> <view>
<image mode="widthFix" class="width90 mart20" :src="imagewxUrl+imgadres"></image> <image mode="widthFix" class="width100" :src="imagewxUrl+imgadres"></image>
<!-- <button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16 fontlet" v-if="!user.phone">授权手机号</button> --> <view class="width100 height45l font14 fcor666 paddleft10 backcorfff">
<!-- <view class="width94">{{code}}</view> --> 授权 <text class="font16 fcor333 fontwig6 sqjl">重庆嗨加油</text> 获取以下信息为您提供相关服务
<UPButton class="mart30 width90 height50 fcorfff backcor008 fotct btns font16 fontlet bornone" @click="btnClick" :scope="scope"> </view>
授权手机号 <button class="width35 flleft mart40 height50 font16"
style="margin-left: 10%;color: #5bbdd6;border: 1px solid #4992ee;" @click="backlatpage">暂不授权</button>
<UPButton class="mart40 width35 height50 fcorfff backcor008 fotct btns font16 fontlet bornone flright"
style="margin-right: 10%;" @click="btnClick" :scope="scope">
确认授权
</UPButton> </UPButton>
<!-- #ifdef H5 -->
<!-- button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16"
@click="getH5userinfo">授权并登录</button> -->
<!-- <view id="app" class="fotct">
<UPButton class="customBtn" @click="getH5userinfo" :scope="scope"
:style="{width:'80%',height:'45px',backgroundColor:'#0083f5'}">
授权并登录
</UPButton>
</view> -->
<!-- #endif -->
<view class="mart10 fcor333 font14">{{resinfo}}</view>
</view> </view>
</template> </template>
@ -24,7 +19,7 @@
const app = getApp(); const app = getApp();
import { import {
getUserInfo, getUserInfo,
GetPhoneNumber, GetPhoneNumber,
unionPhoneLogin unionPhoneLogin
} from "../../Utils/Api.js" } from "../../Utils/Api.js"
export default { export default {
@ -35,8 +30,6 @@
scope: "scope.mobile,scope.auth", scope: "scope.mobile,scope.auth",
imagewxUrl: app.globalData.imageWxImg, imagewxUrl: app.globalData.imageWxImg,
imgadres: 'loginunion.png', imgadres: 'loginunion.png',
imgadres1: 'loginphone.png',
resinfo: '',
scope: "scope.mobile", scope: "scope.mobile",
code: '' code: ''
} }
@ -46,9 +39,9 @@
}, },
methods: { methods: {
btnClick(result) { btnClick(result) {
this.code = result.code; this.code = result.code;
if(result.code){ if (result.code) {
this.unionPhoneLogin(result.code) this.unionPhoneLogin(result.code)
} }
}, },
getuserinfo() { getuserinfo() {
@ -98,18 +91,6 @@
}) })
that.isShowAuth = false that.isShowAuth = false
}, },
//
// reqmessage() {
// uni.requestSubscribeMessage({
// tmplIds: ['oUvaCPeeOg4wH6HTvCcSabU6FnzXUXOBXsqBYAPOV-U'],
// success(res) {
// uni.navigateBack({})
// },
// fail: (res) => {
// uni.navigateBack({})
// }
// })
// },
// //
unionPhoneLogin(item) { unionPhoneLogin(item) {
let params = { let params = {
@ -122,7 +103,7 @@
icon: 'none', icon: 'none',
duration: 2000 duration: 2000
}) })
this.user = res.return_data.object.highUser; this.user = res.return_data.object.highUser;
app.globalData.token = res.return_data.uniqueCode; app.globalData.token = res.return_data.uniqueCode;
app.globalData.userInfo = res.return_data app.globalData.userInfo = res.return_data
.object .object
@ -132,19 +113,19 @@
data: res.return_data data: res.return_data
.object .object
.highUser .highUser
}) })
uni.setStorage({ uni.setStorage({
key: "token", key: "token",
data: res.return_data.uniqueCode data: res.return_data.uniqueCode
}) })
uni.navigateBack({}) uni.navigateBack({})
} }
}); });
}, },
// getH5userinfo(event, err, result) { //
// console.log(event, err, result) backlatpage() {
// this.resinfo = JSON.stringify(result); uni.navigateBack({})
// }, },
getH5userinfo() { getH5userinfo() {
uni.navigateTo({ uni.navigateTo({
url: '/pages/login/register?id=1' url: '/pages/login/register?id=1'
@ -155,6 +136,24 @@
</script> </script>
<style lang="scss"> <style lang="scss">
page {
background-color: #efeff4;
}
.bacolorl {
background: linear-gradient(to right, #408aea, #4890ee);
}
.unionimg {
width: 200rpx;
height: 200rpx;
}
.sqjl {
padding-left: 5px;
padding-right: 5px;
}
.btns { .btns {
border-radius: 6px; border-radius: 6px;
} }

Loading…
Cancel
Save