1.提交代码 更换登录api

yj-dev
杨杰 4 years ago
parent 33876e0857
commit f1f8726917
  1. 12
      App.vue
  2. 44
      components/Authorize.vue
  3. 11
      pages/goods/coupons-info-details/coupons-info-details.vue
  4. 35
      pages/goods/externalCoupon/externalCoupon.vue
  5. 71
      pages/goods/goods.vue
  6. 46
      pages/goods/store-list/store-details.vue
  7. 153
      pages/user/agentCoupons/agentCoupons.vue
  8. 8
      pages/user/minePromotion/minePromotion.vue

@ -1,17 +1,17 @@
<script>
export default {
globalData: {
url: 'http://192.168.3.4:9301/crest',
brestUrl: 'http://192.168.3.4:9302/brest',
imgUrl: 'https://192.168.3.4:9301/filesystem/',
// url: 'http://192.168.3.4:9301/crest',
// brestUrl: 'http://192.168.3.4:9302/brest',
// imgUrl: 'https://192.168.3.4:9301/filesystem/',
//
// url: 'https://hsg.dctpay.com/crest',
// imgUrl: 'https://hsg.dctpay.com/filesystem/',
// brestUrl : 'https://hsg.dctpay.com/brest',
//
// url: 'https://hsgcs.dctpay.com/crest',
// brestUrl : 'https://hsgcs.dctpay.com/brest',
// imgUrl: 'https://hsgcs.dctpay.com/filesystem/',
url: 'https://hsgcs.dctpay.com/crest',
brestUrl : 'https://hsgcs.dctpay.com/brest',
imgUrl: 'https://hsgcs.dctpay.com/filesystem/',
userInfo: "",
brestUserInfo : '',

@ -15,8 +15,8 @@
<button class='item grant' @click="setUserInfo">去授权</button>
<!-- #endif -->
<!-- #ifdef MP -->
<button class='item grant' type="primary" open-type="getUserInfo" lang="zh_CN"
@getuserinfo="getuserinfo" withCredentials="true">去授权</button>
<button class='item grant' type="primary" @click="getuserinfo" lang="zh_CN"
withCredentials="true">去授权</button>
<!-- #endif -->
</view>
</view>
@ -57,17 +57,18 @@
},
getuserinfo() {
uni.showLoading({
title: '正在登录中'
});
// uni.showLoading({
// title: ''
// });
let that = this;
wx.login({
success(res) {
if (res.code) {
// wx.login({
// success(res) {
// if (res.code) {
//
var code = res.code
// var code = res.code
//
uni.getUserInfo({
uni.getUserProfile({
desc: '登录中...',
success: function(res) {
let params = {
openId: app.globalData.openId,
@ -76,7 +77,7 @@
}
getUserInfo(params).then(res => {
if (res.return_code == '000000') {
uni.hideLoading();
// uni.hideLoading();
app.globalData.userInfo = res.return_data
.object
.highUser;
@ -104,6 +105,7 @@
});
},
fail: res => {
console.log('========' + JSON.stringify(res));
uni.showToast({
title: "微信登录授权失败",
icon: "none"
@ -111,16 +113,16 @@
}
})
} else {
fail: res => {
uni.showToast({
title: "微信登录授权失败",
icon: "none"
});
}
}
}
})
// } else {
// fail: res => {
// uni.showToast({
// title: "",
// icon: "none"
// });
// }
// }
// }
// })
that.isShowAuth = false
},
close() {

@ -49,7 +49,9 @@
</template>
<script>
import { getCodeById } from "../../../Utils/Api.js";
import {
getCodeById
} from "../../../Utils/Api.js";
let app = getApp()
export default {
data() {
@ -68,6 +70,11 @@
this.couDesId = option.id;
this.getCodeById();
},
onUnload() {
let pages = getCurrentPages() //
let prePage = pages[pages.length - 2] //
prePage.$vm.reFreshs = Math.random()
},
filters: {
//
formatDate: function(value, spe = '/') {
@ -96,7 +103,7 @@
title: '加载中...'
})
let params = {
couponAgentCodeId: 8
couponAgentCodeId: this.couDesId
}
getCodeById(params).then(res => {
if (res.return_code == '000000') {

@ -14,8 +14,8 @@
</view>
</view>
<view class="line1 mart15"></view>
<button class="coupne-btn width60w mart20 marb20" v-if="userInfo == 1" open-type="getUserInfo" lang="zh_CN"
@getuserinfo="getuserinfo" withCredentials="true">点击领取</button>
<button class="coupne-btn width60w mart20 marb20" v-if="userInfo == 1" lang="zh_CN"
@click="getuserinfo" withCredentials="true">点击领取</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">
@ -186,17 +186,15 @@
},
//
getuserinfo() {
uni.showLoading({
title: '登录中...'
});
let that = this;
wx.login({
success(res) {
if (res.code) {
// wx.login({
// success(res) {
// if (res.code) {
//
var code = res.code
// var code = res.code
//
uni.getUserInfo({
uni.getUserProfile({
desc: '登录中...',
success: function(res) {
let params = {
openId: app.globalData.openId,
@ -236,29 +234,12 @@
});
},
fail: res => {
uni.hideLoading();
uni.showToast({
title: "微信登录授权失败",
icon: "none"
});
}
})
} else {
fail: res => {
uni.hideLoading();
uni.showToast({
title: "微信登录授权失败",
icon: "none"
});
}
}
},
fail(res) {
uni.hideLoading();
}
})
},
//
toGoods(e) {

File diff suppressed because one or more lines are too long

@ -24,8 +24,7 @@
<view class="store-no width80 fontwig6 font20 fcor999 fotct" v-if="menCoupnList == '' && user != ''">
你还没有买券哦~
</view>
<button class="store-no width80 fontwig6 font20 fcor999 fotct" v-if="user == '' " open-type="getUserInfo"
@getuserinfo="getuserinfo">
<button class="store-no width80 fontwig6 font20 fcor999 fotct" v-if="user == '' " @click="getuserinfo">
点击授权查询个人卡券
</button>
@ -109,17 +108,18 @@
methods: {
//
getuserinfo() {
uni.showLoading({
title: '加载中...'
});
// uni.showLoading({
// title: '...'
// });
let that = this;
wx.login({
success(res) {
if (res.code) {
// wx.login({
// success(res) {
// if (res.code) {
//
var code = res.code
// var code = res.code
//
uni.getUserInfo({
uni.getUserProfile({
desc: '登录中...',
success: function(res) {
let params = {
openId: app.globalData.openId,
@ -167,19 +167,19 @@
}
})
} else {
fail: res => {
uni.showToast({
title: "微信登录授权失败",
icon: "none"
});
}
}
},
fail(res) {
uni.hideLoading();
}
})
// } else {
// fail: res => {
// uni.showToast({
// title: "",
// icon: "none"
// });
// }
// }
// },
// fail(res) {
// uni.hideLoading();
// }
// })
},
//

@ -1,26 +1,12 @@
<template>
<view>
<view class="width90 height120 backcorfff mart15">
<image class="flleft agent_img margle mart10" src='../../../static/img/logo.png'></image>
<view class="agent_title paddtop13">
<view class="font18 fcor333 width100">重庆中石化码商券</view>
<view class="width100 mart5 font14 fcor333 height22">
<view class="agent_left_num flleft">
42342424234234
</view>
<view class="agent_right_num flright fotrt">
300.00
</view>
</view>
</view>
<view class="width100 line1 mart5"></view>
<view class="width90">
<button class="flright backcorf06 fcorfff font15 agent_btn mart10" @click="generateCode">生成油码</button>
<view class="agent_ts font15 fcor333 fotrt">出售时间:2021.4.13 23:14</view>
<view class="onorder width90" v-if="agentCouponList.length==0">
<image src="../../../static/img/noorder.png"></image>
<view class="text">
暂无数据...
</view>
</view>
<view class="width90 height120 backcorfff mart15">
<view class="width90 height120 backcorfff mart15" v-for="(agent,index) in agentCouponList" :key="index">
<image class="flleft agent_img margle mart10" src='../../../static/img/logo.png'></image>
<view class="agent_title paddtop13">
<view class="font18 fcor333 width100">重庆中石化码商券</view>
@ -35,27 +21,10 @@
</view>
<view class="width100 line1 mart5"></view>
<view class="width90">
<button class="flright backcorf06 fcorfff font15 agent_btn mart10">生成油码</button>
<view class="agent_ts font15 fcor333 fotrt">出售时间:2021.4.13 23:14</view>
</view>
</view>
<view class="width90 height120 backcorfff mart15">
<image class="flleft agent_img margle mart10" src='../../../static/img/logo.png'></image>
<view class="agent_title paddtop13">
<view class="font18 fcor333 width100">重庆中石化码商券</view>
<view class="width100 mart5 font14 fcor333 height22">
<view class="agent_left_num flleft">
42342424234234
</view>
<view class="agent_right_num flright fotrt">
300.00
</view>
</view>
</view>
<view class="width100 line1 mart5"></view>
<view class="width90">
<button class="flright backcorf06 fcorfff font15 agent_btn mart10">生成油码</button>
<button class="flright backcorf06 fcorfff font15 agent_btn mart10" @click="generateCode(agent.id)"
v-if="typeId == 1">生成油码</button>
<button class="flright backcorf06 fcorfff font15 agent_btn mart10" @click="jumpCouponDes(agent.id)"
v-if="typeId == 2">查看详情</button>
<view class="agent_ts font15 fcor333 fotrt">出售时间:2021.4.13 23:14</view>
</view>
</view>
@ -70,42 +39,91 @@
export default {
data() {
return {
pageNum: 1,
pageSize: 10,
agentCouponList: [],
isNoMoreData: false,
typeId: '',
reFreshs: ""
}
},
onLoad() {
onLoad(option) {
this.typeId = option.id;
},
onShow() {
this.getCodeListByAgentCoupon();
},
watch: {
//reFresh,
reFreshs: function() {
this.pageNum = 1;
this.agentCouponList = []
this.isNoMoreData = false;
this.getCodeListByAgentCoupon();
}
},
methods: {
//
getCodeListByAgentCoupon() {
let datas = {
uni.showLoading({
title: '加载中...'
})
if (this.isNoMoreData) {
uni.hideLoading();
return false;
}
let pagenum = this.pageNum;
let params = {
pageNum: pagenum,
couponId: 23423529,
pageNum: 1,
pageSize: 10
status: this.typeId,
pageSize: this.pageSize
}
getCodeListByAgentCoupon(datas).then(res => {
if (res.return_code == '000000') {} else {
uni.showToast({
title: res.return_msg,
icon: "none"
})
getCodeListByAgentCoupon(params).then(res => {
uni.hideLoading();
if (res.return_code == '000000') {
this.isNoMoreData = res.return_data.list.length == this.pageSize ? false : true;
if (res.return_data.total == (this.pageNum * this.pageSize)) {
this.isNoMoreData = true;
}
this.agentCouponList = this.agentCouponList.concat(res.return_data.list);
this.pageNum = res.return_data.list.length == this.pageSize ? ++pagenum : pagenum;
} else {
this.agentCouponList = [];
}
})
},
//
generateCode() {
generateCode(item) {
uni.showLoading({
title: '油码生成中...'
})
let datas = {
couponAgentCodeId: 8
couponAgentCodeId: item
}
generateCode(datas).then(res => {
if (res.return_code == '000000') {} else {
uni.hideLoading()
if (res.return_code == '000000') {
uni.navigateTo({
url: '../../goods/coupons-info-details/coupons-info-details?id=1'
url: '../../goods/coupons-info-details/coupons-info-details?id=' + item
})
} else {
uni.showToast({
title: res.return_msg,
icon: 'none',
duration: 2000
})
}
})
},
//
jumpCouponDes(ids) {
uni.navigateTo({
url: '../../goods/coupons-info-details/coupons-info-details?id=' + ids
})
}
}
}
</script>
@ -115,6 +133,31 @@
background-color: #f5f5f5;
}
.onorder {
width: 100%;
height: 50vw;
display: flex;
justify-content: center;
align-content: center;
flex-wrap: wrap;
image {
width: 20vw;
height: 20vw;
border-radius: 100%;
}
.text {
width: 100%;
height: 60upx;
font-size: 28upx;
color: #444;
display: flex;
justify-content: center;
align-items: center;
}
}
.agent_img {
width: 50px;
height: 50px;

@ -40,7 +40,7 @@
</view>
</view>
<!-- //:class="[index==0?'colorfe':'']" -->
<view v-for="(mers,index) in minepros" :key="mers.id" class="pro_mok marb10 colore7" @click="jumpAgent">
<view v-for="(mers,index) in minepros" :key="mers.id" class="pro_mok marb10 colore7" @click="jumpAgent(1)">
<view class="width100 font14 fcor333 fontwig6 fotct paddtop10">
面额100
</view>
@ -74,7 +74,7 @@
</view>
</view>
<!-- // -->
<view v-for="(mers,index) in minepros" :key="mers.id" class="pro_mok marb10 colore9" @click="jumpAgent">
<view v-for="(mers,index) in minepros" :key="mers.id" class="pro_mok marb10 colore9" @click="jumpAgent(2)">
<view class="width100 font14 fcor333 fontwig6 fotct paddtop10">
面额100
</view>
@ -124,9 +124,9 @@
})
},
//
jumpAgent() {
jumpAgent(item) {
uni.navigateTo({
url: '../agentCoupons/agentCoupons'
url: '../agentCoupons/agentCoupons?id='+item
})
}
}

Loading…
Cancel
Save