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

master
杨杰 3 years ago
parent 8377c5d683
commit 052d264d6e
  1. 8
      high-unionPay/Utils/Api.js
  2. 3
      high-unionPay/Utils/Request.js
  3. 89
      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. 548
      high-unionPay/pages/tabBar/home/home.vue
  7. 34
      high-unionPay/pages/tabBar/user/user.vue
  8. 20
      high-unionPay/pages/unionPay/unionPay-entrance/unionPay-entrance.vue
  9. 69
      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);
}
//获取设置用户参数
export const getUserParam = params => {
return POST('GET', `${base}/highUser/getUserParam`, params).then(res => res.data);
export const getCacheParam = params => {
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
}, //有的时候这里不一定是 token 还可能是 Authorization
success(res) {
resolve(res)
if (res.statusCode === 401 || res.data.return_code == 102014 || res.data.return_code ==
104001) {
app.globalData.userInfo = '';
@ -37,6 +36,8 @@ function request(method, url, data) {
}, 800);
}
})
}else{
resolve(res)
}
},
fail(err) {

@ -1,6 +1,24 @@
{
"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",
"style" :
{
@ -22,24 +40,6 @@
"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",
"style": {
@ -161,7 +161,7 @@
"backgroundColorTop": "#0083f5",
"navigationBarTextStyle": "white",
"app-plus": {
// "titleNView": false, //
"titleNView": false, //
"subNVues": [{
"id": "userTitleNvue", //
"path": "pages/tabBar/user/subNvue/userTitleNvue", //
@ -310,8 +310,8 @@
"path": "pages/user/order_list/order_list",
"style": {
"navigationBarTitleText": "我的订单",
"navigationBarBackgroundColor": "#f8f8f8",
"backgroundColorTop": "#f3f3f3",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"backgroundColorBottom": "#ffffff"
}
}, {
@ -470,7 +470,11 @@
"path": "pages/userLogin/userLogin",
"style": {
"navigationBarTitleText": "嗨加油",
"enablePullDownRefresh": false
"enablePullDownRefresh": false,
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#0083f5",
"backgroundColorTop": "#0083f5",
"navigationBarTextStyle": "white"
}
}, {
@ -554,31 +558,30 @@
"backgroundColor": "#ffffff",
"backgroundColorTop": "#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": "首页"
// },
},
"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": "我的"
// }
// ]
// }
{
"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 class="line1 mart15"></view>
<button class="coupne-btn width60w mart20 marb20" v-if="userInfo == 1" lang="zh_CN" open-type="getPhoneNumber" @getphonenumber="loginByPhone"
withCredentials="true">点击领取</button>
<button class="coupne-btn width60w mart20 marb20" v-if="userInfo == 1" lang="zh_CN" @click="jumpres">点击领取</button>
<button class="coupne-btn width60w mart20 marb20" v-else @click="receiveDiscount">点击领取</button>
<view class="width90 mart10 fcor666">去使用</view>
<view v-if="minecoupones == '' " class="mart60 fotct font14 fcor666">
@ -105,11 +104,12 @@
}
},
onLoad(options) {
if (app.globalData.userInfo) {
if (app.globalData.userInfo.phone) {
this.userInfo = 2;
} else {
this.userInfo = 1;
}
uni.login({
provider: 'weixin',
success: function(loginRes) {
@ -158,7 +158,6 @@
},
//
receiveDiscount() {
uni.showLoading({
title: '领取中...'
})
@ -166,15 +165,14 @@
codeId: this.couponsDetails.highDiscountAgentCode.id
}
receiveDiscount(params).then(res => {
if (res.return_code == '000000') {
uni.hideLoading();
if (res.return_code == '000000') {
uni.showToast({
icon: 'none',
title: res.return_data,
duration: 2000
})
} else {
uni.hideLoading();
}else{
uni.showToast({
icon: 'none',
title: res.return_msg,
@ -291,6 +289,12 @@
}
});
},
//
jumpres() {
uni.navigateTo({
url:'../../login/register?id=2'
})
},
//
toGoods(e) {
if (app.globalData.userInfo) {

@ -29,19 +29,19 @@
<view class="goodsxg font12 fotct">限购{{row.limitNumber}}</view>
<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;"
src="../../../static/img/jfx.png">
</image> {{ row.discountPrice*100}}
</view>
<view class="price" v-if="typeId == 1">
{{ row.discountPrice*100}}
<view class="price" v-else>
{{ row.discountPrice}}
</view>
<!-- v-if="product.discountPrice !== product.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">
</image> <text v-if="typeId == 1"></text>{{ row.salesPrice*100}}
</image> <text v-else></text>{{ row.salesPrice*100}}
</view>
</view>
</view>
@ -96,6 +96,11 @@
title: '积分列表'
});
}
if (option.id == 3) {
uni.setNavigationBarTitle({
title: '商品列表'
});
}
this.getCouponListArea();
this.getCmsContent();
},

@ -1,41 +1,13 @@
<template>
<view>
<!-- 状态栏 -->
<view v-if="showHeader" class="status"
:style="{ position: headerPosition,top:statusTop,opacity: afterHeaderOpacity}"></view>
<!-- 顶部导航栏 -->
<view v-if="showHeader" class="header"
:style="{ position: headerPosition,top:headerTop,opacity: afterHeaderOpacity }">
<!-- 定位城市 -->
<view class="addr" @click="goPostion">
<!-- <view class="icon location"></view> -->
{{ city }}
<image mode="widthFix" style="width: 15px;" :src="imagewxUrl+imgadres2"></image>
</view>
<!-- 搜索框 -->
<view class="input-box">
<input placeholder="搜索门店" placeholder-style="color:#c0c0c0;" @tap="toSearch()" />
<view class="icon search"></view>
</view>
<!-- 右侧图标按钮 -->
<!-- <view class="icon-btn"> -->
<!-- <view class="icon yuyin-home"></view> -->
<!-- <button open-type="contact" class="icon" show-message-card session-from send-message-path send-message-title> -->
<!-- <image style="width: 30px;height: 30px;" @click="toScan"
src="data:image/png;base64,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">
</image> -->
<!-- </button> -->
<!-- </view> -->
</view>
<!-- 占位 -->
<view v-if="showHeader" class="place"></view>
<!-- 轮播图 -->
<view class="height90 backcor008 viewbor"></view>
<view class="swiper">
<view class="swiper-box">
<swiper circular="true" autoplay="true" @change="swiperChange">
<swiper-item v-for="swiper in swiperList" :key="swiper.id">
<image :src="imageUrl+swiper.imgData" @click="jumplottery(swiper)"></image>
<image :src="imagewxUrl+swiper.img" @click="jumplottery(swiper)"></image>
</swiper-item>
</swiper>
<view class="indicator">
@ -47,38 +19,18 @@
<!-- / -->
<view class="height60 backcorfff"></view>
<view class="category-list">
<view class="category" v-for="(row, index) in categoryList" :key="index" @tap="toCategory(row)">
<view class="category" v-for="(row, index) in categoryList" :key="index" @tap="jumphuafei(row)">
<view class="img">
<image :src="imageUrl+row.imgData"></image>
<image :src="imagewxUrl+row.imgData"></image>
</view>
<view class="text">{{ row.title }}</view>
</view>
</view>
<!-- 积分 -->
<view style="width: 90%;margin-left: 5%;" v-if='goldproductList.length != 0' @click="goGoodsList(2)">
<image class="mart30 width100" mode="widthFix" :src="imagewxUrl+imgadres1"></image>
</view>
<swiper class="orange-content" :display-multiple-items="goldproductListleg" v-if='goldproductList.length != 0'
next-margin="50rpx">
<swiper-item class="swiper-hed" v-for="(item,index) in goldproductList" :key="index"
@click="toGoods(item.id)">
<view class="swiper-item" :data-id="item.id">
<image class="img" :src="imageUrl+item.couponImg" mode="aspectFit"></image>
<view class="fotlt fcor333 font14 text1 mart10">{{item.couponName}}</view>
<view class="subject fotct mart5">
<image style="width: 15px;height: 15px;vertical-align: sub;margin-right: 5px;"
src="../../../static/img/jfx.png">
</image>{{ item.discountPrice*100}}
</view>
</view>
</swiper-item>
</swiper>
<image mode="widthFix" style="margin-top: 30px;width: 90%;margin-left: 5%;" v-for="(row, index) in homeCateList"
:key="index" @click="jumphuafei(row)" :src="imageUrl+row.imgData"></image>
<!-- 赠券 -->
<view style="width: 91%;margin-left: 5%;" v-if='productList.length != 0' @click="goGoodsList(1)">
:key="index" @click="jumphuafei(row)" :src="imagewxUrl+row.imgData"></image>
<!-- 银联赠券 -->
<view style="width: 91%;margin-left: 5%;" v-if='productList.length != 0' @click="goGoodsList(3)">
<image class="mart30 width100" mode="widthFix" :src="imagewxUrl+imgadres"></image>
</view>
<swiper class="orange-content" style="border: 2px solid #ff5836;" v-if='productList.length != 0'
@ -105,10 +57,10 @@
HandleCode,
WXlogin,
getCouponList,
getH5UserInfo,
getH5AccessToken,
getTPigKFCToken,
getTPigCinemaToken,
getCacheParam,
delCacheParam,
getCmsContent,
} from "../../../Utils/Api.js"; //api
import wybPopup from '../../../components/wyb-popup/wyb-popup.vue';
@ -130,7 +82,7 @@
currentSwiper: 0,
imageUrl: app.globalData.imgUrl,
imagewxUrl: app.globalData.imageWxImg,
imgadres: 'headzq.png',
imgadres: 'headunion.png',
imgadres1: 'jbhed.png',
imgadres2: 'jt.png',
imgadres3: '',
@ -156,90 +108,140 @@
pageNum: 1,
pageSize: 6,
//
categoryList: [],
homeCateList: [],
categoryList: [{
'title': '在线加油',
'imgData': 'onRefueling1.png'
},
{
'title': '话费充值',
'imgData': 'phonePay1.png'
},
],
homeCateList: [{
'title': '在线加油',
'imgData': 'onRefueling2.png'
},
{
'title': '话费充值',
'imgData': 'phonePay2.png'
},
],
//
cpStuats: 1,
jumpType:''
jumpType: ''
};
},
onShow() {
// #ifdef H5
var arr1 = window.location.href;
var arr2 = arr1.split('=');
if (!app.globalData.userInfo && arr2[1] != undefined && arr2[2] == '2#/') {
this.getH5UserInfo(arr2[1]);
}
if (app.globalData.userInfo && arr2[1] != undefined && arr2[2] == '1#/') {
this.getH5AccessToken(arr2[1]);
}
// #endif
if (app.globalData.cityName != '') {
this.city = app.globalData.cityName;
this.getCouponListArea();
this.getCouponListgold();
this.getCmsContent();
this.getCmsContentcmshome();
this.getCmsContentcmsContent();
}
},
onLoad(options) {
let that = this;
// 1.wxcode
// #ifdef MP
uni.login({
provider: 'weixin',
success: function(loginRes) {
app.globalData.code = loginRes.code;
//
let params = {
code: app.globalData.code
}
HandleCode(params).then(res => {
if (res.return_code == '000000') {
app.globalData.openId = res.return_data.openId;
}
})
},
})
// #endif
//
this.postionIng();
uni.getStorage({
key: "user",
success(e) {
app.globalData.userInfo = e.data //token
app.globalData.userInfo = e.data; //token
uni.getStorage({
key: 'token',
success(e) {
app.globalData.token = e.data;
},
fail() {
uni.navigateTo({
url: '../../userLogin/userLogin'
})
}
})
if (!app.globalData.userInfo.phone) {
uni.navigateTo({
url: '../../userLogin/userLogin'
})
return;
}
that.getCacheParam();
},
fail: res => {}
fail: res => {
uni.navigateTo({
url: '../../userLogin/userLogin'
})
// #ifdef H5
uni.getStorage({
key: "openId",
success(e) {
app.globalData.openId = e.data
}
})
// if (app.globalData.cityName != '') {
// this.city = app.globalData.cityName;
// this.getCouponListArea();
// this.getCouponListgold();
// this.getCmsContent();
// this.getCmsContentcmshome();
// this.getCmsContentcmsContent();
// }
},
onLoad() {
this.hqaddress();
},
fail: res => {}
methods: {
//ID
getCacheParam() {
let that = this;
let params = {
key: app.globalData.userInfo.phone
}
getCacheParam(params).then(res => {
if (res.return_code == '000000' && res.return_data) {
let datas = res.return_data;
uni.showModal({
title: '优惠券领取',
content: '前往领取优惠券',
success: (res) => {
if (res.confirm) {
uni.navigateTo({
url: '../../goods/externalCoupon/externalCoupon?id=' +
datas
})
// #endif
var arr1mp = decodeURIComponent(options.q);
if (arr1mp) {
var arr2mp = arr1mp.split('=');
if (arr2mp) {
app.globalData.identificationCode = arr2mp[2];
that.delCacheParam();
} else if (res.cancel) {
console.log('用户点击取消');
that.delCacheParam();
}
}
});
}
})
},
//
delCacheParam() {
let params = {
key: app.globalData.userInfo.phone
}
delCacheParam(params).then(res => {
})
},
//
hqaddress() {
let that = this;
upsdk.pluginReady(function() {
upsdk.getLocationCity({
success: function(cityCd) {
app.globalData.cityId = cityCd;
that.getCouponListArea();
},
fail: function(err) {}
});
upsdk.getLocationGps({
success: function(res) {
switch (uni.getSystemInfoSync().platform) {
case 'android':
let zuob = JSON.parse(res);
app.globalData.latitude = zuob.latitude;
app.globalData.longitude = zuob.longitude;
break;
case 'ios':
app.globalData.latitude = res.latitude;
app.globalData.longitude = res.longitude;
break;
}
},
fail: function() {}
});
});
},
methods: {
//
getCmsContentcmsContent() {
let params = {
@ -308,13 +310,13 @@
* 跳转外链
*/
jumpWeb() {
if(this.jumpType == 1){
if (this.jumpType == 1) {
if (this.webUrl) {
uni.navigateTo({
url: '../order/webUrl/webUrl?url=' + this.webUrl
})
}
}else{
} else {
uni.navigateTo({
url: this.webUrl
})
@ -322,126 +324,6 @@
this.closePopup();
},
/**
* 定位
*/
postionIng() {
uni.showLoading({
title: '加载中'
})
let that = this;
uni.getLocation({
type: 'wgs84',
success: function(res) {
app.globalData.latitude = res.latitude;
app.globalData.longitude = res.longitude;
that.getUserLocation(res.longitude, res.latitude);
// #ifdef MP
uni.request({
url: 'https://apis.map.qq.com/ws/geocoder/v1/?location=' + res.latitude +
',' + res.longitude + '&key=7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB',
data: {},
success: function(res) {
// that.city = res.data.result.address_component.city.replace(//g,
// '');
that.city = res.data.result.address_component.province;
app.globalData.cityName = res.data.result.address_component
.province;
app.globalData.cityId = res.data.result.ad_info.adcode;
// app.globalData.cityId = '500100';
that.getCouponListArea();
that.getCouponListgold();
uni.hideLoading();
that.getCmsContent();
that.getCmsAactibity();
that.getCmsContentcmshome();
that.getCmsContentcmsContent();
},
fail() {
uni.hideLoading()
}
})
//#endif
}
})
},
//H5 openId
getH5AccessToken(item) {
let params = {
code: item
}
getH5AccessToken(params).then(res => {
if (res.return_code == '000000') {
app.globalData.openId = res.return_data.openid;
uni.setStorage({
key: "openId",
data: res.return_data.openid
})
}
});
},
//H5
getH5UserInfo(item) {
let params = {
code: item
}
getH5UserInfo(params).then(res => {
if (res.return_code == '000000') {
app.globalData.userInfo = res.return_data
.object
.highUser;
app.globalData.token = res.return_data.uniqueCode;
uni.setStorage({
key: "user",
data: res.return_data
.object
.highUser
})
uni.setStorage({
key: "token",
data: res.return_data.uniqueCode
})
uni.setStorage({
key: "openId",
data: res.return_data
.object
.highUser.openIdH5
})
app.globalData.openId = res.return_data
.object
.highUser.openIdH5;
} else {
uni.showToast({
title: res.return_msg
})
}
});
},
//
getUserLocation(long, lat) {
let vm = this;
let url =
'https://apis.map.qq.com/ws/geocoder/v1?coord_type=5&get_poi=1&output=jsonp&poi_options=page_size=1;page_index=1';
let locationObj = lat + ',' + long;
this.$jsonp(url, {
key: '7UMBZ-HFEHX-HSD4Q-Z3QY6-OQKN7-2QBDB',
location: locationObj
})
.then(res => {
vm.city = res.result.address_component.city.replace(/市/g, '');
app.globalData.cityName = res.result.address_component.city.replace(/市/g, '');
app.globalData.cityId = res.result.ad_info.adcode;
vm.getCouponListArea();
vm.getCouponListgold();
uni.hideLoading()
})
.catch(err => {
uni.hideLoading()
console.log(err);
});
},
//
toSearch() {
uni.navigateTo({
@ -460,32 +342,13 @@
url: '../../goods/goods?id=' + e
});
},
//
toScan() {
uni.scanCode({
success: function(res) {
uni.navigateTo({
url: '../../goods/coupons-info-details/coupons-info-details?id=' + JSON
.parse(res.result).code
})
},
fail() {
uni.showToast({
title: '无法识别二维码',
icon: 'none',
duration: 2000
})
}
});
},
//
//
getCouponListArea() {
let params = {
regionId: app.globalData.cityId,
pageNum: this.pageNum,
pageSize: this.pageSize,
displayArea: 1
displayArea: 3
}
getCouponList(params).then(res => {
if (res.return_code == '000000' && res.return_data.list) {
@ -518,23 +381,6 @@
}
})
},
/**
* 跳转其他小程序
*/
tao(url, id) {
console.log(url);
uni.navigateToMiniProgram({
appId: id,
path: url,
success: res => {
//
console.log("打开成功", res);
},
fail: err => {
console.log(err);
}
});
},
//
swiperChange(event) {
this.currentSwiper = event.detail.current;
@ -542,126 +388,6 @@
eheckStu(item) {
this.cpStuats = item;
},
//
getuserinfos() {
let that = this;
//
uni.getUserProfile({
desc: '登录中...',
success: function(res) {
let params = {
openId: app.globalData.openId,
iv: res.iv,
encryptedData: res.encryptedData
}
getUserInfo(params).then(res => {
if (res.return_code == '000000') {
uni.hideLoading();
uni.showToast({
title: '获取信息成功',
icon: 'none',
duration: 2000
})
app.globalData.userInfo = res
.return_data
.object
.highUser;
app.globalData.token = res
.return_data.uniqueCode;
uni.setStorage({
key: "user",
data: res.return_data
.object
.highUser
})
uni.setStorage({
key: "token",
data: res.return_data
.uniqueCode
})
} else {
uni.hideLoading();
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
});
},
fail: res => {
uni.hideLoading();
uni.showToast({
title: "微信登录授权失败",
icon: "none"
});
}
})
},
//
toCategory(item) {
if (item.title == '在线加油') {
uni.navigateTo({
url: item.ext1
})
} else if (item.title == '肯德基') {
if (!app.globalData.userInfo) {
uni.navigateTo({
url: '../../userLogin/userLogin'
})
return;
}
if (!app.globalData.userInfo.phone) {
uni.navigateTo({
url: '../../userLogin/userLogin'
})
return;
}
uni.navigateTo({
url: '/pages/tabBar/order/order?id=1'
})
} else if (item.title == '电影票') {
if (!app.globalData.userInfo) {
uni.navigateTo({
url: '../../userLogin/userLogin'
})
return;
}
if (!app.globalData.userInfo.phone) {
uni.navigateTo({
url: '../../userLogin/userLogin'
})
return;
}
uni.navigateTo({
url: '/pages/tabBar/order/order?id=2'
})
} else if (item.title == '话费充值') {
if (!app.globalData.userInfo) {
uni.navigateTo({
url: '../../userLogin/userLogin'
})
return;
}
if (!app.globalData.userInfo.phone) {
uni.navigateTo({
url: '../../userLogin/userLogin'
})
return;
}
uni.navigateTo({
url: '/pages/tabBar/order/order?id=3'
})
} else {
uni.showToast({
title: '暂未开通',
icon: 'none',
duration: 2000
})
}
},
//
jumplottery(item) {
if (item.ext1) {
@ -669,7 +395,6 @@
url: item.ext1
})
}
},
//
jumphuafei(item) {
@ -685,12 +410,6 @@
})
return;
}
if (item.title == '汇联通') {
uni.navigateTo({
url: '/pages/goods/goods-list/goods-list?id=2'
})
return;
}
if (item.title == '在线加油') {
uni.navigateTo({
url: '/pages/goods/refuel/refuel'
@ -699,19 +418,7 @@
}
if (item.title == '话费充值') {
uni.navigateTo({
url: '/pages/tabBar/order/order?id=3'
})
return;
}
if (item.title == '电影票') {
uni.navigateTo({
url: '/pages/tabBar/order/order?id=2'
})
return;
}
if (item.title == '肯德基') {
uni.navigateTo({
url: '/pages/tabBar/order/order?id=1'
url:'../../unionPay/recharge/recharge'
})
return;
}
@ -881,7 +588,7 @@
display: flex;
justify-content: center;
position: absolute;
top: 60px;
top: 20px;
.swiper-box {
width: 92%;
@ -1041,7 +748,6 @@
background-color: #FFFFFF;
border-bottom: solid 2upx #f6f6f6;
display: flex;
justify-content: space-between;
flex-wrap: wrap;
.category {

@ -1,8 +1,6 @@
<template>
<view>
<!-- #ifdef H5 -->
<view v-if="showHeader" class="status" :style="{position:headerPosition,top:statusTop}"></view>
<view v-if="showHeader" class="header" :style="{position:headerPosition,top:headerTop}"></view>
<!-- 占位 -->
<view v-if="showHeader" class="place"></view>
<!-- #endif -->
@ -14,7 +12,7 @@
</view>
<!-- 昵称,个性签名 -->
<view class="right">
<view class="username" v-if="!user.name">请授权登录</view>
<view class="username" v-if="!user.name" @click="jumplogin">请授权登录</view>
<view class="username" v-else>{{user.name}}</view>
<!-- <view class="font14 fcorfff" v-if="!user.gold">积分: 0</view> -->
<!-- <view class="font14 fcorfff" v-else>积分: {{user.gold}} </view> -->
@ -174,8 +172,7 @@
icon: "pingjia"
}
],
huafeiList:[
{
huafeiList: [{
text: '待支付',
icon: "fukuan"
},
@ -218,8 +215,7 @@
}
],
// 广
mytgbarList: [
{
mytgbarList: [{
url: '',
text: '客服',
img: 'user/kefu.png'
@ -281,33 +277,33 @@
}
if (!app.globalData.userInfo.isSetPayPwd) {
this.czList = [
{
this.czList = [{
url: '',
text: '客服',
img: 'user/kefu.png'
img: 'user/kefu.png',
type: 1
},
{
url: '../../login/updatePas/updatePas',
text: '设置密码',
img: '../../../static/img/pas.png'
img: '../../../static/img/pas.png',
type: 2
},
]
return;
}
// '../../user/unionCard/unionCard'
this.czList = [
{
this.czList = [{
url: '',
text: '客服',
img: 'user/kefu.png',
type:1
type: 1
},
{
url: '../../login/updatePas/resetPas',
text: '修改密码',
img: '../../../static/img/pas.png',
type:2
type: 2
},
]
},
@ -349,6 +345,12 @@
}
});
},
//
jumplogin() {
uni.navigateTo({
url: '../../userLogin/userLogin'
})
},
// H5
jumpH5Bding() {
uni.navigateTo({
@ -420,7 +422,7 @@
uni.navigateTo({
url: url
})
}else{
} else {
uni.showModal({
title: '客服',
content: '4006780738'

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

@ -1,22 +1,17 @@
<template>
<view>
<image mode="widthFix" class="width90 mart20" :src="imagewxUrl+imgadres"></image>
<!-- <button class="mart30 width90 height50 fcorfff backcor008 fotct btns font16 fontlet" v-if="!user.phone">授权手机号</button> -->
<!-- <view class="width94">{{code}}</view> -->
<UPButton class="mart30 width90 height50 fcorfff backcor008 fotct btns font16 fontlet bornone" @click="btnClick" :scope="scope">
授权手机号
</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'}">
授权并登录
<image mode="widthFix" class="width100" :src="imagewxUrl+imgadres"></image>
<view class="width100 height45l font14 fcor666 paddleft10 backcorfff">
授权 <text class="font16 fcor333 fontwig6 sqjl">重庆嗨加油</text> 获取以下信息为您提供相关服务
</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>
</view> -->
<!-- #endif -->
<view class="mart10 fcor333 font14">{{resinfo}}</view>
</view>
</template>
@ -35,8 +30,6 @@
scope: "scope.mobile,scope.auth",
imagewxUrl: app.globalData.imageWxImg,
imgadres: 'loginunion.png',
imgadres1: 'loginphone.png',
resinfo: '',
scope: "scope.mobile",
code: ''
}
@ -47,7 +40,7 @@
methods: {
btnClick(result) {
this.code = result.code;
if(result.code){
if (result.code) {
this.unionPhoneLogin(result.code)
}
},
@ -98,18 +91,6 @@
})
that.isShowAuth = false
},
//
// reqmessage() {
// uni.requestSubscribeMessage({
// tmplIds: ['oUvaCPeeOg4wH6HTvCcSabU6FnzXUXOBXsqBYAPOV-U'],
// success(res) {
// uni.navigateBack({})
// },
// fail: (res) => {
// uni.navigateBack({})
// }
// })
// },
//
unionPhoneLogin(item) {
let params = {
@ -141,10 +122,10 @@
}
});
},
// getH5userinfo(event, err, result) {
// console.log(event, err, result)
// this.resinfo = JSON.stringify(result);
// },
//
backlatpage() {
uni.navigateBack({})
},
getH5userinfo() {
uni.navigateTo({
url: '/pages/login/register?id=1'
@ -155,6 +136,24 @@
</script>
<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 {
border-radius: 6px;
}

Loading…
Cancel
Save