Commit 91653df4 authored by 华国豪's avatar 华国豪 🙄

新增代码

parent 39b20993
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
let md5 = require('utils/md5.js') let md5 = require('utils/md5.js')
let javaUrl = 'https://efficient.oytour.com/'; let javaUrl = 'https://efficient.oytour.com/';
// let javaUrl = 'http://47.96.12.235:9001/'; // let javaUrl = 'http://47.96.12.235:9001/';
// let netUrl = 'https://reborn.oytour.com/api/common/post'; let netUrl = 'https://reborn.oytour.com/api/common/post';
let netUrl = 'http://192.168.2.214:8082/api/Common/Post'; // let netUrl = 'http://192.168.2.214:8082/api/Common/Post';
App({ App({
// 小程序初始化时 // 小程序初始化时
onLaunch: function(options) { onLaunch: function(options) {
...@@ -17,29 +17,14 @@ App({ ...@@ -17,29 +17,14 @@ App({
onError: function(msg) {}, onError: function(msg) {},
// 用户token // 用户token
token: '', token: '',
isLogin: wx.getStorageSync('admin') ? 1 :0, isLogin: wx.getStorageSync('admin').Id ? 1 :0,
GuestId: 0,
// 全局状态 // 全局状态
state: { state: {
admin: { admin: {
account: wx.getStorageSync('admin') ? wx.getStorageSync('admin').account:'', id: 0,
address: wx.getStorageSync('admin') ? wx.getStorageSync('admin').address:'', openId: null,
businessCardPhotos: wx.getStorageSync('admin') ? wx.getStorageSync('admin').businessCardPhotos:null,
contact: wx.getStorageSync('admin') ? wx.getStorageSync('admin').contact:'',
customerAccountId: wx.getStorageSync('admin') ? wx.getStorageSync('admin').customerAccountId:0,
housePhotos: wx.getStorageSync('admin') ? wx.getStorageSync('admin').housePhotos:null,
images: wx.getStorageSync('admin') ? wx.getStorageSync('admin').images:null,
isMember: wx.getStorageSync('admin') ? wx.getStorageSync('admin').isMember :0,
name: wx.getStorageSync('admin') ? wx.getStorageSync('admin').name :'',
photo: wx.getStorageSync('admin') ? wx.getStorageSync('admin').photo :'',
secretKey: wx.getStorageSync('admin') ? wx.getStorageSync('admin').secretKey :'',
token: wx.getStorageSync('admin') ? wx.getStorageSync('admin').token :'',
customerName: wx.getStorageSync('admin') ? wx.getStorageSync('admin').customerName : '',
id: wx.getStorageSync('admin') ? wx.getStorageSync('admin').id : 5
},
site:{
companyId: wx.getStorageSync('site') ? wx.getStorageSync('site').companyId : 0,
cityId: wx.getStorageSync('site') ? wx.getStorageSync('site').cityId : 262,
siteName: wx.getStorageSync('site') ? wx.getStorageSync('site').siteName : '成都站'
}, },
companyId: wx.getStorageSync('site') ? wx.getStorageSync('site').companyId : 0, companyId: wx.getStorageSync('site') ? wx.getStorageSync('site').companyId : 0,
cityId: wx.getStorageSync('site') ? wx.getStorageSync('site').cityId:262, cityId: wx.getStorageSync('site') ? wx.getStorageSync('site').cityId:262,
...@@ -63,7 +48,7 @@ App({ ...@@ -63,7 +48,7 @@ App({
timestamp: timestamp, timestamp: timestamp,
token: getApp().state.admin.token, token: getApp().state.admin.token,
sign: sign, sign: sign,
uid: getApp().state.admin.id uid: 0
}, },
success(res) { success(res) {
wx.hideLoading() wx.hideLoading()
......
...@@ -33,7 +33,7 @@ Page({ ...@@ -33,7 +33,7 @@ Page({
let id = e.currentTarget.dataset.id let id = e.currentTarget.dataset.id
app.$api('Shop_post_SetCommodityShopInfo', { app.$api('Shop_post_SetCommodityShopInfo', {
CommodityId: id, CommodityId: id,
GuestId: app.state.admin.id, GuestAccountId: app.state.admin.id,
CustomerId: 0, CustomerId: 0,
Number: 1, Number: 1,
}).then(res => { }).then(res => {
...@@ -130,6 +130,12 @@ Page({ ...@@ -130,6 +130,12 @@ Page({
}) })
}) })
}, },
goDerails2: function (e) {
let src = e.currentTarget.dataset.src
wx.navigateTo({
url: src,
})
},
goDerails: function(e){ goDerails: function(e){
let id = e.currentTarget.dataset.id let id = e.currentTarget.dataset.id
wx.navigateTo({ wx.navigateTo({
...@@ -137,12 +143,15 @@ Page({ ...@@ -137,12 +143,15 @@ Page({
}) })
}, },
register: function (){ register: function (){
app.$api('ShopGuest_post_SetGuestAccountService', { app.$api('ShopGuest_post_CreateGuestAccountService', {
WeChatOpenId: this.data.openId, WeChatOpenId: this.data.openId,
GuestId: app.state.admin.id, GuestId: app.GuestId,
}).then(r => { }).then(r => {
console.log(r) app.state.admin.id = r.Id
this.getUserInfo() wx.setStorage({
key: 'admin',
data: r,
})
}).catch(err => { }).catch(err => {
}) })
...@@ -151,7 +160,10 @@ Page({ ...@@ -151,7 +160,10 @@ Page({
app.$api('ShopGuest_get_GetGuestAccountByOpenIdService', { app.$api('ShopGuest_get_GetGuestAccountByOpenIdService', {
OpenId: this.data.openId OpenId: this.data.openId
}).then(r => { }).then(r => {
console.log(r) wx.setStorage({
key: 'admin',
data: r,
})
}).catch(err => { }).catch(err => {
}) })
...@@ -160,14 +172,10 @@ Page({ ...@@ -160,14 +172,10 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
if (options.GuestId) { if (typeof (options.GuestId) !== "undefined") {
app.state.admin.id = options.GuestId app.GuestId = options.GuestId
wx.setStorage({ } else {
key: "admin", app.GuestId = 0
data: {
id: options.GuestId
}
})
} }
wx.login({ wx.login({
success: res => { success: res => {
...@@ -177,6 +185,7 @@ Page({ ...@@ -177,6 +185,7 @@ Page({
app.$apiNew('ShopGuest_get_GetShopWeChatOpenIdService', { app.$apiNew('ShopGuest_get_GetShopWeChatOpenIdService', {
code: res.code code: res.code
}).then(r => { }).then(r => {
app.state.admin.openId = r
this.setData({ this.setData({
openId: r openId: r
}) })
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}"> autoplay="{{autoplay}}" interval="{{interval}}" duration="{{duration}}">
<block wx:for="{{imgList}}" wx:key="index"> <block wx:for="{{imgList}}" wx:key="index">
<swiper-item> <swiper-item>
<image src="{{item.ShowImage}}"></image> <image src="{{item.ShowImage}}" bindtap="goDerails2" data-src="{{item.AdLink}}"></image>
</swiper-item> </swiper-item>
</block> </block>
</swiper> </swiper>
......
...@@ -107,4 +107,12 @@ ...@@ -107,4 +107,12 @@
.zhi-pro-item-info .zhi-pro-item-price .gouwuche image{ .zhi-pro-item-info .zhi-pro-item-price .gouwuche image{
width: 36rpx; width: 36rpx;
height: 32rpx; height: 32rpx;
}
.modal{
width: calc(100vw);
height: calc(100vh);
background-color: rgba(0,0,0,.5);
position: fixed;
left: 0;
top: 0;
} }
\ No newline at end of file
...@@ -35,7 +35,7 @@ Page({ ...@@ -35,7 +35,7 @@ Page({
addGwc: function (e) { addGwc: function (e) {
app.$api('Shop_post_SetCommodityShopInfo', { app.$api('Shop_post_SetCommodityShopInfo', {
CommodityId: this.data.proId, CommodityId: this.data.proId,
GuestId: app.state.admin.id, GuestAccountId: app.state.admin.id,
CustomerId: 0, CustomerId: 0,
Number: 1, Number: 1,
}).then(res => { }).then(res => {
......
...@@ -126,7 +126,7 @@ Page({ ...@@ -126,7 +126,7 @@ Page({
}, },
getGwc: function () { getGwc: function () {
app.$api('Shop_post_GetCommodityShopNumber', { app.$api('Shop_post_GetCommodityShopNumber', {
GuestId: app.state.admin.id, GuestAccountId: app.state.admin.id,
}).then(res => { }).then(res => {
this.setData({ this.setData({
allNumber: res allNumber: res
...@@ -148,7 +148,7 @@ Page({ ...@@ -148,7 +148,7 @@ Page({
let id = e.currentTarget.dataset.id let id = e.currentTarget.dataset.id
app.$api('Shop_post_SetCommodityShopInfo', { app.$api('Shop_post_SetCommodityShopInfo', {
CommodityId: id, CommodityId: id,
GuestId: app.state.admin.id, GuestAccountId: app.state.admin.id,
CustomerId: 0, CustomerId: 0,
Number: 1, Number: 1,
}).then(res => { }).then(res => {
......
...@@ -12,9 +12,50 @@ Page({ ...@@ -12,9 +12,50 @@ Page({
AddrYes: true, AddrYes: true,
isGowuche: false, isGowuche: false,
isOrder: false, isOrder: false,
openId: '' openId: '',
islogin: true
},
onGotUserInfo: function (e) {
console.log(e)
if (e.detail.userInfo) {
let userInfo = e.detail.userInfo
app.$api('ShopGuest_post_SetGuestAccountService', {
AccountName: userInfo.nickName,
Id: app.state.admin.id,
Sex: userInfo.gender
}).then(r => {
app.$api('ShopGuest_get_GetGuestAccountByOpenIdService', {
OpenId: app.state.admin.openId
}).then(r => {
this.setData({
islogin: true
})
wx.setStorage({
key: 'admin',
data: r,
})
}).catch(err => {
})
}).catch(err => {
})
} else {
wx.navigateBack({
delta: 1
})
}
}, },
setOrder: function(){ setOrder: function(){
if (!this.data.AddrObj.Id) {
wx.showToast({
title: '请添加/新增收货地址',
icon: 'none',
duration: 2000
})
return
}
let orderId = null let orderId = null
if (this.data.isOrder) { if (this.data.isOrder) {
// 已下单未支付 // 已下单未支付
...@@ -24,16 +65,16 @@ Page({ ...@@ -24,16 +65,16 @@ Page({
}) })
} else { } else {
let msg = { let msg = {
GuestId: app.state.admin.id, GuestAccountId: app.state.admin.id,
ShopList: [], ShopList: [],
GuestAddressId: this.data.AddrObj.Id, GuestAddressId: this.data.AddrObj.Id,
WeChatOpenId: this.data.openId WeChatOpenId: app.state.admin.openId
} }
this.data.dataList.map(x => { this.data.dataList.map(x => {
let obj = { let obj = {
"Id": 0, "Id": 0,
"CustomerId": 0, "CustomerId": 0,
"GuestId": 0, "GuestAccountId": 0,
"CommodityId": 0, "CommodityId": 0,
"CostPrice": 0, "CostPrice": 0,
"SellPrice": 0, "SellPrice": 0,
...@@ -46,7 +87,7 @@ Page({ ...@@ -46,7 +87,7 @@ Page({
obj.Number = x.number obj.Number = x.number
msg.ShopList.push(obj) msg.ShopList.push(obj)
}) })
app.$api(' ', msg).then(res => { app.$api('ShopOrder_post_AddCommodityOrderService', msg).then(res => {
console.log(res) console.log(res)
orderId = res orderId = res
wx.redirectTo({ wx.redirectTo({
...@@ -137,25 +178,16 @@ Page({ ...@@ -137,25 +178,16 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
wx.login({ let _this = this
success: res => { wx.getSetting({
// 登录注册接口 success(res) {
if (res.code) { if (!res.authSetting['scope.userInfo']) {
// 调用服务端登录接口,发送 res.code 到服务器端换取 openId, sessionKey, unionId并存入数据库中 _this.setData({
app.$apiNew('ShopGuest_get_GetShopWeChatOpenIdService', { islogin: false
code: res.code
}).then(r => {
this.setData({
openId: r
})
}).catch(err => {
}) })
} else {
console.log('登录失败!' + res.errMsg)
} }
} }
}); })
if (typeof (options.isGowuche) !== "undefined") { if (typeof (options.isGowuche) !== "undefined") {
this.setData({ this.setData({
isGowuche: true isGowuche: true
......
<view class="Settlement commonF"> <view class="Settlement commonF">
<view class="Settlement-addr"> <view>
<view wx:if="{{AddrYes}}"> <view class="Settlement-addr">
<view class="sar-tit f28 c11">{{AddrObj.LinkMan}} <text>{{AddrObj.LinkTel}}</text></view> <view wx:if="{{AddrYes}}">
<view class="sar-info"> <view class="sar-tit f28 c11">{{AddrObj.LinkMan}} <text>{{AddrObj.LinkTel}}</text></view>
<image src="/images/mine/dingwei2.png"></image> <view class="sar-info">
<view class="text2 f28 c22">{{AddrObj.DetaileAddress}}</view> <image src="/images/mine/dingwei2.png"></image>
<view class="edit-btn f28" bindtap="jumpEidtAddrPage" data-index="1">修改</view> <view class="text2 f28 c22">{{AddrObj.DetaileAddress}}</view>
<view class="edit-btn f28" bindtap="jumpEidtAddrPage" data-index="1">修改</view>
</view>
</view>
<view class="add-btn f30" bindtap="jumpEidtAddrPage" wx:else>
<text>新建收货地址</text>
</view> </view>
</view> </view>
<view class="add-btn f30" bindtap="jumpEidtAddrPage" wx:else> <image class="se-line" src="/images/mine/line.png"></image>
<text>新建收货地址</text> <view class="Gray30"></view>
<scroll-view class="Settlement-scroll-view" scroll-y>
<view class="sett-pro-item" wx:for="{{dataList}}" wx:key="index">
<view class="left">
<image mode="aspectFit" src="{{item.FlowImgList[0]}}"></image>
</view>
<view class="right c11 bold">
<view class="f26 text2">{{item.Name}}</view>
<view class="price">
<view class="f28">¥ {{item.SellPrice}}</view>
<view class="f22 c88">x{{item.number}}</view>
</view>
</view>
</view>
</scroll-view>
<view class="peisong-allprice">
<view class="peisong">
<view class="f28 c11">配送方式 <text class="f24 c99">快递</text> </view>
<view class="f24 c11">免运费</view>
</view>
<view class="allprice">
<text class="f24 c99">共2件 </text>
<text class="f24 c11">小计: <text class="f30 cee">¥{{allPrice}}</text></text>
</view>
</view> </view>
</view> <view class="Gray30"></view>
<image class="se-line" src="/images/mine/line.png"></image> <view class="pay-way" bindtap="changePayway">
<!-- <view class="Gray30"></view>
<view class="shenfenz f24 c11">
<view>身份证号</view>
<view>5139**********1234</view>
</view> -->
<view class="Gray30"></view>
<scroll-view class="Settlement-scroll-view" scroll-y>
<view class="sett-pro-item" wx:for="{{dataList}}" wx:key="index">
<view class="left"> <view class="left">
<image mode="aspectFit" src="{{item.FlowImgList[0]}}"></image> <image src="/images/mine/wechat.png"></image>
<text class="f30 c11">微信支付</text>
</view> </view>
<view class="right c11 bold"> <view class="right">
<view class="f26 text2">{{item.Name}}</view> <view class="raduis" wx:if="{{!wxPay}}"></view>
<view class="price"> <image src="/images/product/xuanzhong.png" wx:else></image>
<view class="f28">¥ {{item.SellPrice}}</view>
<view class="f22 c88">x{{item.number}}</view>
</view>
</view> </view>
</view> </view>
</scroll-view> <view class="tips f22 c99">点击支付则表示您同意 <text class="c11">《用户购买须知》</text></view>
<view class="peisong-allprice"> <view class="pay-box">
<view class="peisong"> <view class="f24">
<view class="f28 c11">配送方式 <text class="f24 c99">快递</text> </view> 总计: <text class="cee bold f30">¥{{allPrice}}</text>
<view class="f24 c11">免运费</view> </view>
</view> <view class="pay-btn f30 cff" bindtap="setOrder">
<view class="allprice"> 立即支付
<text class="f24 c99">共2件 </text> </view>
<text class="f24 c11">小计: <text class="f30 cee">¥{{allPrice}}</text></text>
</view>
</view>
<view class="Gray30"></view>
<view class="pay-way" bindtap="changePayway">
<view class="left">
<image src="/images/mine/wechat.png"></image>
<text class="f30 c11">微信支付</text>
</view>
<view class="right">
<view class="raduis" wx:if="{{!wxPay}}"></view>
<image src="/images/product/xuanzhong.png" wx:else></image>
</view> </view>
</view> </view>
<view class="tips f22 c99">点击支付则表示您同意 <text class="c11">《用户购买须知》</text></view> <view wx:if="{{!islogin}}" class="no-login">
<view class="pay-box"> <button class="f26" size="mini" type="primary" open-type="getUserInfo" lang="zh_CN" bindgetuserinfo="onGotUserInfo">微信授权登录</button>
<view class="f24">
总计: <text class="cee bold f30">¥{{allPrice}}</text>
</view>
<view class="pay-btn f30 cff" bindtap="setOrder">
立即支付
</view>
</view> </view>
</view> </view>
\ No newline at end of file
...@@ -138,4 +138,15 @@ ...@@ -138,4 +138,15 @@
border-radius:37rpx; border-radius:37rpx;
margin-top: 40rpx; margin-top: 40rpx;
color: rgba(226,20,54,1); color: rgba(226,20,54,1);
}
.no-login{
height: calc(100vh);
width: calc(100vw);
display: flex;
align-items: center;
justify-content: center;
position: fixed;
left: 0;
top: 0;
background-color: rgba(0, 0, 0, .3)
} }
\ No newline at end of file
...@@ -62,7 +62,9 @@ Page({ ...@@ -62,7 +62,9 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
wx.setNavigationBarTitle({
title: '分类'
})
}, },
/** /**
......
...@@ -16,7 +16,7 @@ Page({ ...@@ -16,7 +16,7 @@ Page({
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
CustomerId: 0, CustomerId: 0,
GuestId: app.state.admin.id, GuestAccountId: app.state.admin.id,
}, },
totalPage: 0, totalPage: 0,
pageIndex: 1, pageIndex: 1,
...@@ -181,13 +181,8 @@ Page({ ...@@ -181,13 +181,8 @@ Page({
if (res.confirm) { if (res.confirm) {
app.$api('Shop_post_DelCommodityShopInfo', { app.$api('Shop_post_DelCommodityShopInfo', {
Id: id, Id: id,
GuestId: app.state.admin.id GuestAccountId: app.state.admin.id,
}).then(res => { }).then(res => {
wx.showToast({
title: '删除成功',
icon: 'none',
duration: 2000
})
_this.getList() _this.getList()
_this.calculationPrice() _this.calculationPrice()
}).catch(err => { }).catch(err => {
...@@ -204,6 +199,10 @@ Page({ ...@@ -204,6 +199,10 @@ Page({
}) })
}, },
getList: function (type) { getList: function (type) {
if (!app.state.admin.id) {
return
}
this.data.msg.GuestAccountId = app.state.admin.id
if (this.data.pageIndex >= this.data.totalPage && type) { if (this.data.pageIndex >= this.data.totalPage && type) {
return return
} }
...@@ -248,7 +247,9 @@ Page({ ...@@ -248,7 +247,9 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
wx.setNavigationBarTitle({
title: '购物车'
})
}, },
/** /**
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view class="zonghe f24 c11"> <view class="zonghe f24 c11">
共{{dataList.length}}件宝贝 共{{dataList.length}}件宝贝
</view> </view>
<scroll-view class="ShoppingCart-scroll-view" scroll-y bindscrolltolower="scrollGetMore"> <scroll-view class="ShoppingCart-scroll-view" scroll-y bindscrolltolower="scrollGetMore" wx:if="{{dataList.length > 0}}">
<view class="ShoppingCart-item bb1e9" wx:for="{{dataList}}" wx:key="index" data-index="{{index}}" bindtouchstart="drawStart" bindtouchmove="drawMove" bindtouchend="drawEnd" style="right:{{item.right}}rpx"> <view class="ShoppingCart-item bb1e9" wx:for="{{dataList}}" wx:key="index" data-index="{{index}}" bindtouchstart="drawStart" bindtouchmove="drawMove" bindtouchend="drawEnd" style="right:{{item.right}}rpx">
<view class="check-box" data-index="{{index}}" bindtap="selectItem"> <view class="check-box" data-index="{{index}}" bindtap="selectItem">
<view wx:if="{{!item.select}}" class="raduis"></view> <view wx:if="{{!item.select}}" class="raduis"></view>
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
<view class="remove" bindtap="delItem" data-id="{{item.Id}}">删除 </view> <view class="remove" bindtap="delItem" data-id="{{item.Id}}">删除 </view>
</view> </view>
</scroll-view> </scroll-view>
<view class="btn-info-box"> <view class="btn-info-box" wx:if="{{dataList.length > 0}}">
<view class="check-box" bindtap="checkAll"> <view class="check-box" bindtap="checkAll">
<view wx:if="{{!selectAll}}" class="raduis"></view> <view wx:if="{{!selectAll}}" class="raduis"></view>
<image wx:else src="/images/product/xuanzhong.png"></image> <image wx:else src="/images/product/xuanzhong.png"></image>
...@@ -49,4 +49,8 @@ ...@@ -49,4 +49,8 @@
<view wx:else class="f30 cff">去结算({{selectNum}})</view> <view wx:else class="f30 cff">去结算({{selectNum}})</view>
</view> </view>
</view> </view>
<view class="f26 c88 center kongkong" wx:if="{{dataList.length == 0}}">
<image src="/images/product/gouwuche-big.png"></image>
<view>购物车空空如也</view>
</view>
</view> </view>
\ No newline at end of file
...@@ -117,4 +117,13 @@ ...@@ -117,4 +117,13 @@
} }
.btn-info-box-btn view.submit{ .btn-info-box-btn view.submit{
background:linear-gradient(90deg,rgba(226,20,54,1),rgba(253,78,107,1)); background:linear-gradient(90deg,rgba(226,20,54,1),rgba(253,78,107,1));
}
.kongkong{
padding: 100rpx 30rpx 0 30rpx;
background-color: #F5F5F5;
}
.kongkong image{
width: 150rpx;
height: 150rpx;
margin-bottom: 20rpx;
} }
\ No newline at end of file
...@@ -5,7 +5,8 @@ Page({ ...@@ -5,7 +5,8 @@ Page({
* 页面的初始数据 * 页面的初始数据
*/ */
data: { data: {
userInfo: {},
islogin: true
}, },
jumpPage: function(e){ jumpPage: function(e){
let url = e.currentTarget.dataset.url let url = e.currentTarget.dataset.url
...@@ -13,12 +14,47 @@ Page({ ...@@ -13,12 +14,47 @@ Page({
url: url, url: url,
}) })
}, },
onGotUserInfo: function (e) {
console.log(e.detail.userInfo)
if (e.detail.userInfo) {
let userInfo = e.detail.userInfo
app.$api('ShopGuest_post_SetGuestAccountService', {
AccountName: userInfo.nickName,
Id: app.state.admin.id,
Sex: userInfo.gender
}).then(r => {
app.$api('ShopGuest_get_GetGuestAccountByOpenIdService', {
OpenId: app.state.admin.openId
}).then(r => {
this.setData({
userInfo: r,
islogin: true
})
wx.setStorage({
key: 'admin',
data: r,
})
}).catch(err => {
})
}).catch(err => {
})
}
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
let _this = this
wx.getStorage({
key: 'admin',
success: function(res) {
_this.setData({
userInfo: res.data
})
},
})
}, },
/** /**
...@@ -32,7 +68,20 @@ Page({ ...@@ -32,7 +68,20 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
let _this = this;
wx.getSetting({
success(res) {
if (!res.authSetting['scope.userInfo']) {
_this.setData({
islogin: false
})
} else {
_this.setData({
islogin: true
})
}
}
})
}, },
/** /**
......
<view class="mine commonF"> <view class="mine commonF">
<view class="top"> <view>
<view class="head-name"> <view class="top" >
<view class="top-head"> <view class="head-name">
<view> <view class="top-head">
<image src="https://profile.csdnimg.cn/A/E/0/3_chijinrong4312"></image> <view>
<image src="https://profile.csdnimg.cn/A/E/0/3_chijinrong4312"></image>
</view>
</view>
<view class="f32 c11" wx:if="{{islogin}}">
{{userInfo.AccountName}}
</view>
<view wx:else class="no-login">
<button class="f26" size="mini" type="primary" open-type="getUserInfo" lang="zh_CN" bindgetuserinfo="onGotUserInfo">微信授权登录</button>
</view> </view>
</view> </view>
<view class="f32 c11"> <view class="bottom-line"></view>
唐先生
</view>
</view>
<view class="bottom-line"></view>
</view>
<view class="order-box">
<view class="order-box-tit">
<view class="c30 c11 bold">我的订单</view>
<view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=0">
<text class="f24 c99">查看更多</text><image src="/images/product/right.png"></image>
</view>
</view> </view>
<view class="order-type"> <view class="order-box" wx:if="{{islogin}}">
<view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=2"> <view class="order-box-tit">
<view> <view class="c30 c11 bold">我的订单</view>
<image src="/images/mine/qianbao.png"></image> <view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=0">
<text class="f24 c99">查看更多</text><image src="/images/product/right.png"></image>
</view> </view>
<view>待付款</view>
</view> </view>
<view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=5"> <view class="order-type">
<view> <view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=2">
<image src="/images/mine/baoguo.png"></image> <view>
<image src="/images/mine/qianbao.png"></image>
</view>
<view>待付款</view>
</view> </view>
<view>待发货</view> <view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=5">
</view> <view>
<view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=6"> <image src="/images/mine/baoguo.png"></image>
<view> </view>
<image src="/images/mine/che.png"></image> <view>待发货</view>
</view> </view>
<view>待收货</view> <view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=6">
</view> <view>
<view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=7"> <image src="/images/mine/che.png"></image>
<view> </view>
<image src="/images/mine/wancheng.png"></image> <view>待收货</view>
</view>
<view bindtap="jumpPage" data-url="/pages/mine/mineOrder/mineOrder?type=7">
<view>
<image src="/images/mine/wancheng.png"></image>
</view>
<view>已完成</view>
</view> </view>
<view>已完成</view>
</view>
</view>
</view>
<view class="Gray30"></view>
<view class="gongneng">
<view class="g-row bb1e9" bindtap="jumpPage" data-url="/pages/mine/mineAddrList/mineAddrList">
<view class="g-row-left">
<image mode='widthFix' class="icon-img" src="/images/mine/dingwei.png"></image>
<text>收货地址</text>
</view>
<image class="right-img" src="/images/product/right.png"></image>
</view>
<view class="g-row bb1e9">
<view class="g-row-left">
<image mode='widthFix' class="icon-img" src="/images/mine/kefu.png"></image>
<text>客服中心</text>
</view> </view>
<image class="right-img" src="/images/product/right.png"></image>
</view> </view>
<view class="g-row bb1e9"> <view class="Gray30" wx:if="{{islogin}}"></view>
<view class="g-row-left"> <view class="gongneng" wx:if="{{islogin}}">
<image mode='widthFix' class="icon-img" src="/images/mine/xinfeng.png"></image> <view class="g-row bb1e9" bindtap="jumpPage" data-url="/pages/mine/mineAddrList/mineAddrList">
<text>意见反馈</text> <view class="g-row-left">
<image mode='widthFix' class="icon-img" src="/images/mine/dingwei.png"></image>
<text>收货地址</text>
</view>
<image class="right-img" src="/images/product/right.png"></image>
</view> </view>
<image class="right-img" src="/images/product/right.png"></image> <!-- <view class="g-row bb1e9">
<view class="g-row-left">
<image mode='widthFix' class="icon-img" src="/images/mine/kefu.png"></image>
<text>客服中心</text>
</view>
<image class="right-img" src="/images/product/right.png"></image>
</view> -->
<!-- <view class="g-row bb1e9">
<view class="g-row-left">
<image mode='widthFix' class="icon-img" src="/images/mine/xinfeng.png"></image>
<text>意见反馈</text>
</view>
<image class="right-img" src="/images/product/right.png"></image>
</view> -->
</view> </view>
</view> </view>
</view> </view>
\ No newline at end of file
...@@ -28,6 +28,7 @@ Page({ ...@@ -28,6 +28,7 @@ Page({
}) })
}, },
seveMsg: function () { seveMsg: function () {
this.data.msg.GuestAccountId = app.state.admin.id
if (!this.data.msg.LinkMan){ if (!this.data.msg.LinkMan){
wx.showToast({ wx.showToast({
title: '请填写收货人', title: '请填写收货人',
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
}, },
"compileType": "miniprogram", "compileType": "miniprogram",
"libVersion": "2.7.7", "libVersion": "2.7.7",
"appid": "wxb6bcc99626870225", "appid": "wx32833ebd278dfc43",
"projectname": "DAIGOU", "projectname": "DAIGOU",
"cloudfunctionTemplateRoot": "", "cloudfunctionTemplateRoot": "",
"watchOptions": { "watchOptions": {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment