Commit 39b20993 authored by 华国豪's avatar 华国豪 🙄

no message

parent 1c1a1fdf
......@@ -84,6 +84,31 @@ App({
})
return promise;
},
$apiNew: function (url, data) {
var promise = new Promise((resolve, reject) => {
wx.showLoading({
title: '加载中',
});
let timestamp = (new Date()).valueOf()
let sign = md5('cmd=' + url + '&' + 'msg=' + encodeURIComponent(data).toLowerCase() + '&' + 'timestamp=' + timestamp + '&' + 'token=' + getApp().state.admin.token + '&' + 'key=' + '')
wx.request({
url: netUrl,
method: 'POST',
data: {
cmd: url,
msg: data,
timestamp: timestamp,
token: getApp().state.admin.token,
sign: sign
},
success(res) {
wx.hideLoading()
resolve(res.data.data);
}
})
})
return promise;
},
// 请求接口
$apiSaveFormId: function (url, data) {
var promise = new Promise((resolve, reject) => {
......
images/tarbar/fenlei.png

758 Bytes | W: | H:

images/tarbar/fenlei.png

656 Bytes | W: | H:

images/tarbar/fenlei.png
images/tarbar/fenlei.png
images/tarbar/fenlei.png
images/tarbar/fenlei.png
  • 2-up
  • Swipe
  • Onion skin
images/tarbar/fenlei1.png

773 Bytes | W: | H:

images/tarbar/fenlei1.png

673 Bytes | W: | H:

images/tarbar/fenlei1.png
images/tarbar/fenlei1.png
images/tarbar/fenlei1.png
images/tarbar/fenlei1.png
  • 2-up
  • Swipe
  • Onion skin
images/tarbar/gouwuche.png

1.46 KB | W: | H:

images/tarbar/gouwuche.png

1.53 KB | W: | H:

images/tarbar/gouwuche.png
images/tarbar/gouwuche.png
images/tarbar/gouwuche.png
images/tarbar/gouwuche.png
  • 2-up
  • Swipe
  • Onion skin
images/tarbar/gouwuche1.png

1.27 KB | W: | H:

images/tarbar/gouwuche1.png

1.6 KB | W: | H:

images/tarbar/gouwuche1.png
images/tarbar/gouwuche1.png
images/tarbar/gouwuche1.png
images/tarbar/gouwuche1.png
  • 2-up
  • Swipe
  • Onion skin
images/tarbar/home.png

1.26 KB | W: | H:

images/tarbar/home.png

1.31 KB | W: | H:

images/tarbar/home.png
images/tarbar/home.png
images/tarbar/home.png
images/tarbar/home.png
  • 2-up
  • Swipe
  • Onion skin
images/tarbar/home1.png

1.32 KB | W: | H:

images/tarbar/home1.png

1.4 KB | W: | H:

images/tarbar/home1.png
images/tarbar/home1.png
images/tarbar/home1.png
images/tarbar/home1.png
  • 2-up
  • Swipe
  • Onion skin
images/tarbar/wode.png

1.39 KB | W: | H:

images/tarbar/wode.png

1.5 KB | W: | H:

images/tarbar/wode.png
images/tarbar/wode.png
images/tarbar/wode.png
images/tarbar/wode.png
  • 2-up
  • Swipe
  • Onion skin
images/tarbar/wode1.png

1.07 KB | W: | H:

images/tarbar/wode1.png

1.57 KB | W: | H:

images/tarbar/wode1.png
images/tarbar/wode1.png
images/tarbar/wode1.png
images/tarbar/wode1.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -16,6 +16,7 @@ Page({
newList: [],
hotList: [],
imgList: [],
openId: ''
},
goSearchPage: function (){
wx.navigateTo({
......@@ -36,7 +37,6 @@ Page({
CustomerId: 0,
Number: 1,
}).then(res => {
console.log(res)
wx.showToast({
title: '添加成功',
icon: 'none',
......@@ -52,7 +52,6 @@ Page({
},
getImgList: function () {
app.$api('ShopAd_get_GetAdManageListService', {}).then(res => {
console.log(res)
this.setData(
{
imgList: res
......@@ -75,7 +74,6 @@ Page({
OrderBy: 1,
OrderType: 2
}).then(res => {
console.log(res)
let list = res.pageData
this.setData(
{
......@@ -99,7 +97,6 @@ Page({
OrderType: 2,
ListType: 1,
}).then(res => {
console.log(res)
let list = res.pageData
this.setData(
{
......@@ -134,12 +131,31 @@ Page({
})
},
goDerails: function(e){
console.log(e)
let id = e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/Product/ProductDetails/ProductDetails?id=' + id,
})
},
register: function (){
app.$api('ShopGuest_post_SetGuestAccountService', {
WeChatOpenId: this.data.openId,
GuestId: app.state.admin.id,
}).then(r => {
console.log(r)
this.getUserInfo()
}).catch(err => {
})
},
getUserInfo: function () {
app.$api('ShopGuest_get_GetGuestAccountByOpenIdService', {
OpenId: this.data.openId
}).then(r => {
console.log(r)
}).catch(err => {
})
},
/**
* 生命周期函数--监听页面加载
*/
......@@ -153,9 +169,29 @@ Page({
}
})
}
wx.login({
success: res => {
// 登录注册接口
if (res.code) {
// 调用服务端登录接口,发送 res.code 到服务器端换取 openId, sessionKey, unionId并存入数据库中
app.$apiNew('ShopGuest_get_GetShopWeChatOpenIdService', {
code: res.code
}).then(r => {
this.setData({
openId: r
})
this.register()
}).catch(err => {
})
} else {
console.log('登录失败!' + res.errMsg)
}
}
});
},
onGotUserInfo: function (e) {
console.log(e)
},
/**
* 生命周期函数--监听页面初次渲染完成
......
......@@ -34,8 +34,6 @@
width: 100%;
background-color: #1AAD19;
}
.scroll-view_H{
}
.top-fenlei{
display: flex;
}
......
......@@ -38,9 +38,14 @@ Page({
})
this.getList()
},
goDerails: function (e) {
let id = e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/Product/ProductDetails/ProductDetails?id=' + id,
})
},
changeSort: function (e) {
let type = e.currentTarget.dataset.type
console.log(type)
if (type == 'saleSor') {
this.setData({
'msg.OrderBy': 1,
......@@ -85,7 +90,6 @@ Page({
return
}
app.$api('Shop_post_GetPageList', this.data.msg).then(res => {
console.log(res)
let arr = this.data.dataList;
let arr2 = []
res.pageData.map(x => {
......@@ -100,7 +104,6 @@ Page({
} else {
arr = arr2
}
console.log(arr)
this.setData({
dataList: arr,
totalPage: res.pageCount ? res.pageCount : 1,
......@@ -149,7 +152,6 @@ Page({
CustomerId: 0,
Number: 1,
}).then(res => {
console.log(res)
this.getGwc()
wx.showToast({
title: '添加成功',
......@@ -168,7 +170,6 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
let searchKey = ''
if (typeof (options.searchKey) !== "undefined") {
searchKey = options.searchKey
......@@ -178,6 +179,7 @@ Page({
})
this.setData({
'msg.pageIndex': 1,
pageIndex: 1,
selectNum: 0,
allMoney: 0,
allShuiMoney: 0,
......
......@@ -12,17 +12,22 @@ Page({
AddrYes: true,
isGowuche: false,
isOrder: false,
openId: ''
},
setOrder: function(){
let orderId = null
if (this.data.isOrder) {
// 已下单未支付
orderId = this.data.dataList[0].CorderId
wx.redirectTo({
url: '/pages/Product/payOK/payOK?id=' + orderId,
})
} else {
let msg = {
GuestId: app.state.admin.id,
ShopList: [],
GuestAddressId: this.data.AddrObj.Id
GuestAddressId: this.data.AddrObj.Id,
WeChatOpenId: this.data.openId
}
this.data.dataList.map(x => {
let obj = {
......@@ -41,9 +46,12 @@ Page({
obj.Number = x.number
msg.ShopList.push(obj)
})
app.$api('ShopOrder_post_AddCommodityOrderService', msg).then(res => {
app.$api(' ', msg).then(res => {
console.log(res)
// orderId = this.data.dataList[0].CorderId
orderId = res
wx.redirectTo({
url: '/pages/Product/payOK/payOK?id=' + orderId,
})
}).catch(err => {
wx.showToast({
title: err.message,
......@@ -52,10 +60,6 @@ Page({
})
})
}
console.log(orderId)
wx.redirectTo({
url: '/pages/Product/payOK/payOK?id=' + orderId,
})
},
jumpEidtAddrPage: function (e) {
let url = "/pages/mine/mineAddrEdit/mineAddrEdit"
......@@ -75,7 +79,6 @@ Page({
app.$api('ShopGuest_get_GetGuestAddressListService', {
GuestAccountId: app.state.admin.id
}).then(res => {
console.log(res, res.length < 1)
if (res.length < 1) {
this.setData({
AddrYes: false
......@@ -117,7 +120,6 @@ Page({
wx.getStorage({
key: 'product',
success: function(res) {
console.log(res)
let list = res.data
let price = 0;
list.map(x=>{
......@@ -135,6 +137,25 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
wx.login({
success: res => {
// 登录注册接口
if (res.code) {
// 调用服务端登录接口,发送 res.code 到服务器端换取 openId, sessionKey, unionId并存入数据库中
app.$apiNew('ShopGuest_get_GetShopWeChatOpenIdService', {
code: res.code
}).then(r => {
this.setData({
openId: r
})
}).catch(err => {
})
} else {
console.log('登录失败!' + res.errMsg)
}
}
});
if (typeof (options.isGowuche) !== "undefined") {
this.setData({
isGowuche: true
......
......@@ -12,7 +12,6 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
wx.setNavigationBarTitle({
title: '查看物流'
})
......
// pages/Product/payOK/payOK.js
Page({
/**
* 页面的初始数据
*/
data: {
orderId: null,
},
goDetais: function (){
wx.redirectTo({
url: '/pages/mine/mineOrder/mineOrderDetails/mineOrderDetails?id=' + this.data.orderId,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
orderId: options.id
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<view class="payok commonF">
<image src="/images/product/payok.png"></image>
<view class="f26 c11">支付成功, <text class="cee" bindtap="goDetais">查看订单 ></text></view>
</view>
\ No newline at end of file
.payok{
padding: 118rpx 0 0 0;
text-align: center;
height: calc(100vh);
}
.payok image{
margin-bottom: 30rpx;
width: 95rpx;
height: 95rpx;
}
\ No newline at end of file
// pages/mine/mine.js
let app = getApp();
Page({
/**
* 页面的初始数据
*/
data: {
},
jumpPage: function(e){
let url = e.currentTarget.dataset.url
......@@ -13,11 +13,12 @@ Page({
url: url,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
......
......@@ -23,7 +23,6 @@ Page({
IsDefaultShow: true,
},
switch1Change: function (e){
console.log(e)
this.setData({
switch1Checked: e.detail.value
})
......@@ -82,7 +81,6 @@ Page({
})
},
regionChange: function (e) {
console.log(e)
this.setData({
province: e.detail.province,
city: e.detail.city,
......@@ -93,7 +91,6 @@ Page({
});
},
inputName: function (e) {
console.log(e)
let id = e.target.id,
value = e.detail.value;
if (id == 'name') {
......@@ -134,7 +131,6 @@ Page({
county: res.data.GuestDistrictCounty,
switch1Checked: r.IsDefault ? true : false
})
console.log(_this.data.msg)
}
})
}
......
......@@ -84,7 +84,6 @@ Page({
},
cancelOrder: function(e) {
let id = e.currentTarget.dataset.id
console.log(id)
let _this = this;
wx.showModal({
title: '提示',
......@@ -159,7 +158,6 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options.type * 1)
if (options.type) {
this.setData({
active: options.type * 1 === 0 ? -1 : options.type * 1
......
......@@ -39,7 +39,6 @@ Page({
init: function (){
let id = this.data.CorderId
app.$api('ShopOrder_get_GetCommodityOrderDetailsService', { CorderId: id }).then(res => {
console.log(res)
this.setData({
CorderId: id,
details: res
......@@ -84,7 +83,6 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
this.setData({
CorderId: options.id
})
......
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