作者 王楠

“增加办公采办”

App({
onLaunch: function () {
if(wx.getStorageSync('token')){
if (wx.getStorageSync('token')) {
this.getmessagelist()
}
... ... @@ -34,26 +34,40 @@ App({
})
},
post: function (url, data, showLoad) {
wx.showNavigationBarLoading()
var promise = new Promise((resolve, reject) => {
//init
let that = this;
let postData = data , baseUrl;
let postData = data, baseUrl;
// let baseUrl = 'https://binhai.w.broing.cn/api';
// let baseUrl ='http://binhaitest.w.brotop.cn/api'
// 现在用的
// let baseUrl = 'https://binhai.w.broing.cn/api'
// let baseUrl = 'http://binhaitest.w.brotop.cn/api'
// 滨海
var entrance_type = wx.getStorageSync("entrance_type");
console.log(entrance_type);
if(entrance_type == '1'||url=='/getopenid/get'||url.indexOf('address')>-1){
if (entrance_type == '1' || url == '/getopenid/get' || url.indexOf('address') > -1) {
//劳保商城入口
baseUrl = 'https://binhai.w.broing.cn/api';
}else{
} else if (entrance_type == '2') {
//工会商城入口
baseUrl = 'https://binhaigh.w.broing.cn/api';
} else if (entrance_type == '3') {
//工会商城入口
baseUrl = 'https://bgcb.w.broing.cn/api';
}
// 天远甄选
// if (entrance_type == '1' || url == '/getopenid/get' || url.indexOf('address') > -1) {
// //劳保商城入口
// baseUrl = 'https://binhai2.w.broing.cn/api';
// } else if (entrance_type == '2') {
// //工会商城入口
// baseUrl = 'https://binhaigh2.w.broing.cn/api';
// } else if (entrance_type == '3') {
// //工会商城入口
// baseUrl = 'https://bgcb2.w.broing.cn/api';
// }
console.log(baseUrl);
//网络请求
wx.request({
... ... @@ -65,7 +79,7 @@ App({
'token': wx.getStorageSync('token') || ''
},
success: function (res) { //返回取得的数据
console.log('ssssssssssssssssssssssssssssssssssss',res)
console.log('ssssssssssssssssssssssssssssssssssss', res)
if (res.data.code == '200') {
resolve(res.data)
} else if (res.data.code == '5000') {
... ... @@ -78,11 +92,11 @@ App({
showCancel: false
})
wx.removeStorageSync('token');
setTimeout(()=>{
setTimeout(() => {
wx.navigateTo({
url: '/pages/register/register?type=1',
})
},1200)
}, 1200)
} else {
wx.showModal({
... ... @@ -104,21 +118,26 @@ App({
});
return promise;
},
getToken(){
let that= this;
getToken() {
let that = this;
let u = that.interface.getToken;
wx.login({
success: (result) => {
that.postk(u, {
code: result.code
}).then((r) => {
console.log(r)
wx.setStorageSync('token', r.data.token)
wx.setStorageSync('login', r.data.login_new1)
wx.setStorageSync('gh_login', r.data.login_new2)
wx.setStorageSync('cb_login', r.data.login_new3)
wx.setStorageSync('sq', r.data.sq1)
wx.setStorageSync('gh_sq', r.data.sq2)
wx.setStorageSync('cb_sq', r.data.sq3)
})
},
fail: (res) => {},
complete: (res) => {},
fail: (res) => { },
complete: (res) => { },
})
},
// 开放商城公共接口
... ... @@ -128,10 +147,10 @@ App({
//init
let that = this;
let postData = data
// let baseUrl = 'https://binhai.w.broing.cn/api';
// let baseUrl ='http://binhaitest.w.brotop.cn/api'
// 滨海
let baseUrl = 'https://binhaidispark.w.broing.cn/api'
// 天远甄选
// let baseUrl = 'https://binhaidispark2.w.broing.cn/api'
//网络请求
wx.request({
... ... @@ -154,10 +173,10 @@ App({
// url: '/pages/register/register?type=1',
// })
} else {
wx.showModal({
title: '提示',
content: res.data.msg,
showCancel: false
wx.showToast({
title: res.data.msg,
icon: 'none',
})
reject(res.data)
}
... ... @@ -222,10 +241,10 @@ App({
// 获取个人信息
getInfoFun() {
let that= this;
let that = this;
let u = that.interface.readteacher;
that.post(u, {}).then((r) => {
console.log('3489523498',r)
console.log('3489523498', r)
if (r.code == 200) {
wx.setStorageSync('login', r.msg.login_new)
... ... @@ -260,7 +279,7 @@ App({
}
})
console.log('77889944556',newlist)
console.log('77889944556', newlist)
if (newlist.length != 0) {
wx.showTabBarRedDot({
index: 1,
... ... @@ -278,7 +297,7 @@ App({
}).catch((err) => { })
},
onShow: function() {
onShow: function () {
console.log('hahahahhahahahhhahh')
},
... ... @@ -338,7 +357,12 @@ App({
order_read: '/shop/read', // 订单数
},
globalData: {
login_new:"",
baseUrlimg :'https://binhaidispark.w.broing.cn/'
login_new: "",
// 滨海
baseUrlimg: 'https://binhaidispark.w.broing.cn/',
// 天远
// baseUrlimg: 'https://binhaidispark2.w.broing.cn/api',
}
})
// 滨海wx73497072e7340d61
// 天远wx2980402f625c4f80
\ No newline at end of file
... ...
let type = wx.getStorageSync('selecttype');
console.log(type, '类型')
Component({
data: {
selected: 0,
... ... @@ -48,7 +47,7 @@ Component({
value: ''
},
},
attached() {},
attached() { },
onLoad() {
},
... ...
// pages/birthday/birthday.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(options)
// if(options.type == 1){
// wx.setNavigationBarTitle({
// title: '生日福利',
// })
// }else{
// wx.setNavigationBarTitle({
// title: '电影福利',
// })
// }
wx.setNavigationBarTitle({
title: options.type==1?'生日福利':'电影福利',
title: '生日电影福利',
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
... ...
const app =getApp()
const app = getApp()
Page({
/**
... ... @@ -6,16 +6,16 @@ Page({
*/
data: {
status: 0,
taocan:false,
page:1,
taocanlist:[],
remain:true,
page:1,
good_arr:[],
taocanpage:1,
kindshow:true,
taocan: false,
page: 1,
taocanlist: [],
remain: true,
page: 1,
good_arr: [],
taocanpage: 1,
kindshow: true,
// 品牌
letter: ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z","*"],
letter: ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "*"],
cityListId: '',
//下面是城市列表信息,这里只是模拟数据
citylist: [{ "letter": "A", "data": [{ "id": "v7", "cityName": "安徽" }] }, { "letter": "B", "data": [{ "id": "v10", "cityName": "巴中" }, { "id": "v4", "cityName": "包头" }, { "id": "v1", "cityName": "北京" }] }, { "letter": "C", "data": [{ "id": "v15", "cityName": "成都" }] }, { "letter": "D", "data": [{ "id": "v21", "cityName": "稻城" }] }, { "letter": "G", "data": [{ "id": "v17", "cityName": "广州" }, { "id": "v29", "cityName": "桂林" }] }, { "letter": "H", "data": [{ "id": "v9", "cityName": "海南" }, { "id": "v3", "cityName": "呼和浩特" }] }, { "letter": "L", "data": [{ "id": "v24", "cityName": "洛阳" }, { "id": "v20", "cityName": "拉萨" }, { "id": "v14", "cityName": "丽江" }] }, { "letter": "M", "data": [{ "id": "v13", "cityName": "眉山" }] }, { "letter": "N", "data": [{ "id": "v27", "cityName": "南京" }] }, { "letter": "S", "data": [{ "id": "v18", "cityName": "三亚" }, { "id": "v2", "cityName": "上海" }] }, { "letter": "T", "data": [{ "id": "v5", "cityName": "天津" }] }, { "letter": "W", "data": [{ "id": "v12", "cityName": "乌鲁木齐" }, { "id": "v25", "cityName": "武汉" }] }, { "letter": "X", "data": [{ "id": "v23", "cityName": "西安" }, { "id": "v28", "cityName": "香港" }, { "id": "v19", "cityName": "厦门" }] }, { "letter": "Z", "data": [{ "id": "v8", "cityName": "张家口" }] }],
... ... @@ -23,17 +23,17 @@ Page({
newcity: ['北京', '上海', '广州', '深圳', '成都', '杭州'],
// citySel: '全国',
locateCity: '',
len:''
len: ''
},
// 种类和品牌切换
selkind(){
selkind() {
this.setData({
kindshow:true
kindshow: true
})
},
selpinpai(){
selpinpai() {
this.setData({
kindshow:false
kindshow: false
})
},
... ... @@ -41,9 +41,9 @@ Page({
//点击进入商品列表
cityTap(e) {
console.log(e)
let id=e.currentTarget.dataset.id;
let id = e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/pinpaibox/pinpaibox?pinpaiid='+id,
url: '/pages/pinpaibox/pinpaibox?pinpaiid=' + id,
})
},
... ... @@ -51,7 +51,7 @@ Page({
letterTap(e) {
const Item = e.currentTarget.dataset.item;
console.log(Item)
if(Item=='*'){
if (Item == '*') {
this.setData({
scrollHeight: this.data.len
});
... ... @@ -59,7 +59,7 @@ Page({
this.setData({
cityListId: Item
});
console.log("..............."+this.data.cityListId);
console.log("..............." + this.data.cityListId);
},
//调用定位
getLocate() {
... ... @@ -79,28 +79,28 @@ Page({
});
},
// 获取品牌列表
getpinpailist(){
getpinpailist() {
let that = this
let url = '/sundry/get_brand'
let params = {
type:2
type: 2
}
app.postk(url,params).then((res) => {
app.postk(url, params).then((res) => {
console.log(res)
that.setData({
citylist:res.data,
citylist: res.data,
})
let len = res.data.length;
len=len*542;
len = len * 542;
this.setData({
len:len
len: len
})
})
},
//查看更多
look_more(e){
look_more(e) {
let pid = e.currentTarget.dataset.id
let title = e.currentTarget.dataset.title
wx.navigateTo({
... ... @@ -108,7 +108,7 @@ Page({
})
},
//查看商品详情
look_detail(e){
look_detail(e) {
let id = e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/shop_detail/shop_detail?id=' + id
... ... @@ -116,7 +116,7 @@ Page({
},
// 查看套餐 详情
look_detailk(e){
look_detailk(e) {
let id = e.currentTarget.dataset.id
wx.navigateTo({
url: '/pages/taocandetail/taocandetail?id=' + id
... ... @@ -125,16 +125,16 @@ Page({
//点击分类
click_category(e) {
let index = e.currentTarget.dataset.index
if(index == this.data.status){
if (index == this.data.status) {
return
}
this.setData({
status: index,
taocan:false,
remain:true
taocan: false,
remain: true
})
this.setData({
page:1,
page: 1,
// good_arr:[]
})
... ... @@ -161,8 +161,8 @@ Page({
// }
// res.msg.push(obj)
let tempArry = [];
for(let obj of res.data){
if(obj.child.length>0){
for (let obj of res.data) {
if (obj.child.length > 0) {
tempArry.push(obj)
}
}
... ... @@ -181,43 +181,43 @@ Page({
let url = '/sundry/get_category_goods'
let params = {
category_id: pid,
page:that.data.page,
pageNum:6
page: that.data.page,
pageNum: 6
}
app.postk(url, params).then((res) => {
wx.hideLoading()
this.setData({
good_arr: that.data.page == 1?res.data:that.data.good_arr.concat(res.data)
good_arr: that.data.page == 1 ? res.data : that.data.good_arr.concat(res.data)
})
})
},
seltaocan(){
seltaocan() {
this.setData({
taocan:true,
page:1,
taocanlist:[],
status:-1,
remain:false
taocan: true,
page: 1,
taocanlist: [],
status: -1,
remain: false
})
this.gettaocan()
},
// 获取套餐
gettaocan(){
gettaocan() {
wx.showLoading({
title: '加载中',
})
let that = this
let url = '/combo/get_list'
let params = {
page:that.data.taocanpage,
pageNum:10
page: that.data.taocanpage,
pageNum: 10
}
app.postk(url, params).then((res) => {
console.log(res)
wx.hideLoading()
this.setData({
taocanlist:that.data.taocanlist.concat(res.data)
taocanlist: that.data.taocanlist.concat(res.data)
})
console.log(that.data.taocanlist)
})
... ... @@ -249,13 +249,13 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
if(options.type==1){
if (options.type == 1) {
this.setData({
kindshow:true
kindshow: true
})
}else{
} else {
this.setData({
kindshow:false
kindshow: false
})
}
this.get_info();
... ... @@ -304,10 +304,10 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
let newpage=this.data.gettaocan;
let newpage = this.data.gettaocan;
newpage++;
this.setData({
gettaocan:newpage
gettaocan: newpage
})
this.gettaocan()
... ...
<view class="pinlist">
<view class="pinitem {{kindshow==true?'pinitemactive':''}}" bindtap="selkind">分类</view>
<view class="pinitem {{kindshow==false?'pinitemactive':''}}" bindtap="selpinpai">品牌</view>
</view>
</view>
<!-- 分类 -->
<view class='page' wx:if="{{kindshow}}">
<view class='top'>
... ... @@ -17,7 +16,9 @@
<!-- <scroll-view scroll-y class='scroll-view' scroll-into-view="NAV{{status}}"> -->
<view class='center_child flexone'>
<view class='left'>
<view class='left_item {{status == index?"active":""}}' id='Nav{{index}}' wx:for='{{nav_arr}}' wx:key='index' bindtap='{{item.id!=""?"click_category":"seltaocan"}}' data-index='{{index}}' data-id='{{item.id}}' wx:if="{{item.child.length>0}}">{{item.name}}</view>
<view class='left_item {{status == index?"active":""}}' id='Nav{{index}}' wx:for='{{nav_arr}}'
wx:key='index' bindtap='{{item.id!=""?"click_category":"seltaocan"}}' data-index='{{index}}'
data-id='{{item.id}}' wx:if="{{item.child.length>0}}">{{item.name}}</view>
<!-- <view class='left_item {{taocan == true?"active":""}}' bindtap="seltaocan">套餐专区</view> -->
</view>
<!-- <view class='fake_left'></view> -->
... ... @@ -28,10 +29,12 @@
<!-- wx:if="{{good_arr[index].products.length>0}}" -->
<view class='right_item_top'>
<view class='right_left'>{{item.name}}</view>
<text decode='{{true}}' catchtap="look_more" data-id="{{item.id}}" data-title="{{item.name}}">查看全部&ensp;&gt;</text>
<text decode='{{true}}' catchtap="look_more" data-id="{{item.id}}"
data-title="{{item.name}}">查看全部&ensp;&gt;</text>
</view>
<view class='right_goods'>
<view class='goods' wx:for="{{item.goods}}" wx:for-item="zitem" wx:for-index="zindex" wx:key="zindex" data-id="{{zitem.id}}" catchtap="look_detail">
<view class='goods' wx:for="{{item.goods}}" wx:for-item="zitem" wx:for-index="zindex"
wx:key="zindex" data-id="{{zitem.id}}" catchtap="look_detail">
<view class='goods_img'>
<image src='{{zitem.image}}'></image>
</view>
... ... @@ -45,7 +48,8 @@
<view clas="nodata" wx:if="{{taocanlist.length==0}}">暂无数据</view>
<view class="right_item" wx:else>
<view class='right_goods'>
<view class='goods' wx:for="{{taocanlist}}" wx:key="zindex" data-id="{{item.id}}" catchtap="look_detailk">
<view class='goods' wx:for="{{taocanlist}}" wx:key="zindex" data-id="{{item.id}}"
catchtap="look_detailk">
<view class='goods_img'>
<image src='{{item.image}}'></image>
</view>
... ... @@ -61,13 +65,15 @@
<!-- 品牌 -->
<view class='city_box' wx:else>
<view class='city_left'>
<scroll-view scroll-y style='width:100%;height:100%;' scroll-with-animation scroll-into-view='{{cityListId}}' scroll-top="{{scrollHeight}}">
<scroll-view scroll-y style='width:100%;height:100%;' scroll-with-animation scroll-into-view='{{cityListId}}'
scroll-top="{{scrollHeight}}">
<view class='city_list_box'>
<block wx:for='{{citylist}}' wx:key='this' wx:for-item='letterItem' wx:for-index='letterIndex'>
<view class='city_first_letter' id='{{letterItem.letter}}'>{{letterItem.letter}}</view>
<view class="citybox">
<view class='city_name' wx:for='{{letterItem.data}}' wx:key='this' data-types='list' catchtap='cityTap' data-index='{{index}}' data-val='{{item}}' data-id="{{item.id}}">
<view class='city_name' wx:for='{{letterItem.data}}' wx:key='this' data-types='list'
catchtap='cityTap' data-index='{{index}}' data-val='{{item}}' data-id="{{item.id}}">
<view class='goods_img'>
<image src='{{item.image}}'></image>
</view>
... ... @@ -79,8 +85,9 @@
</scroll-view>
</view>
<view class='city_right'>
<scroll-view scroll-y style='width:100%;height:100%;' scroll-with-animation >
<text class='letter_item' wx:for='{{letter}}' wx:key='this' catchtap='letterTap' data-item='{{item}}'>{{item}}</text>
<scroll-view scroll-y style='width:100%;height:100%;' scroll-with-animation>
<text class='letter_item' wx:for='{{letter}}' wx:key='this' catchtap='letterTap'
data-item='{{item}}'>{{item}}</text>
</scroll-view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -98,7 +98,7 @@ Page({
wx.navigateTo({
url: '/pages/register/register',
})
} else if (res.cancel) {}
} else if (res.cancel) { }
}
})
return false
... ... @@ -110,18 +110,18 @@ Page({
onPageScroll(e) {
let t = this;
console.log(e)
wx.createSelectorQuery().select('#tuijianTop').boundingClientRect(function(rect){
wx.createSelectorQuery().select('#tuijianTop').boundingClientRect(function (rect) {
console.log(rect)
if(rect.top < 60) {
if (rect.top < 60) {
t.setData({
stick: 1
})
}else {
} else {
t.setData({
stick: 0
})
}
}).exec()
}).exec()
},
// 公告详情
noticedetail(e) {
... ... @@ -136,8 +136,10 @@ Page({
wx.setStorageSync('entrance_type', '1')
let token = wx.getStorageSync('token');
let login = wx.getStorageSync('login')
let sq = wx.getStorageSync('sq')
console.log(token)
if (token == '') {
if (token == ''||sq==2) {
// wx.showToast({
// title: '请登录后操作',
// icon: 'none',
... ... @@ -149,7 +151,7 @@ Page({
})
// }, 1000)
} else {
if(login==1){
if (login == 1) {
// wx.showLoading({
// title: '模块加载中',
// })
... ... @@ -159,7 +161,7 @@ Page({
})
// },1000)
}else{
} else {
// wx.showLoading({
// title: '加载中',
// duration: 1200
... ... @@ -179,8 +181,10 @@ Page({
wx.setStorageSync('entrance_type', '2')
let token = wx.getStorageSync('token');
let gh_login = wx.getStorageSync('gh_login');
let sq = wx.getStorageSync('gh_sq')
console.log(token)
if (token == '') {
console.log(sq)
if (token == ''||sq == 2) {
// wx.showLoading({
// title: '模块加载中',
// })
... ... @@ -190,7 +194,7 @@ Page({
})
// }, 1000)
} else {
if(gh_login==1){
if (gh_login == 1) {
// wx.showLoading({
// title: '模块加载中',
// })
... ... @@ -203,7 +207,7 @@ Page({
url: '/packageA/pages/index/index',
})
// },1000)
}else{
} else {
// wx.showLoading({
// title: '加载中',
// mask: true
... ... @@ -218,6 +222,50 @@ Page({
}
},
// 进入办公采办
canban() {
wx.setStorageSync('entrance_type', '3')
let token = wx.getStorageSync('token');
let cb_login = wx.getStorageSync('cb_login');
let sq = wx.getStorageSync('cb_sq')
console.log(token)
if (token == ''||sq==2) {
// wx.showLoading({
// title: '模块加载中',
// })
// setTimeout(function () {
wx.navigateTo({
url: '/pages/register/register',
})
// }, 1000)
} else {
if (cb_login == 1) {
// wx.showLoading({
// title: '模块加载中',
// })
// setTimeout(()=>{
// wx.showLoading({
// title: '加载中',
// duration: 1200
// })
wx.navigateTo({
url: '/packageA/pages/index/index',
})
// },1000)
} else {
// wx.showLoading({
// title: '加载中',
// mask: true
// })
// setTimeout(()=>{
wx.navigateTo({
url: '/pages/login/login',
})
// },1000)
}
}
},
// 进入差旅
chailv() {
... ... @@ -261,7 +309,7 @@ Page({
} else {
console.log(e)
wx.navigateTo({
url: '/pages/birthday/birthday?type='+e.currentTarget.id,
url: '/pages/birthday/birthday?type=' + e.currentTarget.id,
})
}
... ... @@ -359,9 +407,9 @@ Page({
this.setData({
shop_arr: res.data
})
if(res.data.length==0){
if (res.data.length == 0) {
this.setData({
stick:0
stick: 0
})
}
}
... ... @@ -399,7 +447,7 @@ Page({
wx.navigateTo({
url: '/pages/register/register',
})
} else if (res.cancel) {}
} else if (res.cancel) { }
}
})
} else {
... ... @@ -428,7 +476,7 @@ Page({
}).catch((err) => {})
}).catch((err) => { })
},
// 限时抢购
... ... @@ -460,7 +508,7 @@ Page({
// console.log(that.data.messagelist)
}).catch((err) => {})
}).catch((err) => { })
},
date_format(micro_second) {
... ... @@ -526,7 +574,7 @@ Page({
// console.log(that.data.messagelist)
}).catch((err) => {})
}).catch((err) => { })
},
// 活动专区查看更多
... ... @@ -542,7 +590,7 @@ Page({
wx.navigateTo({
url: '/pages/register/register',
})
} else if (res.cancel) {}
} else if (res.cancel) { }
}
})
} else {
... ... @@ -586,7 +634,7 @@ Page({
})
}).catch((err) => {})
}).catch((err) => { })
},
more() {
let token = wx.getStorageSync("token")
... ... @@ -599,7 +647,7 @@ Page({
wx.navigateTo({
url: '/pages/register/register',
})
} else if (res.cancel) {}
} else if (res.cancel) { }
}
})
... ... @@ -628,7 +676,7 @@ Page({
wx.navigateTo({
url: '/pages/register/register',
})
} else if (res.cancel) {}
} else if (res.cancel) { }
}
})
} else {
... ... @@ -790,30 +838,30 @@ Page({
seltui: index,
})
if(index==0){
if (index == 0) {
if(this.data.stick==1){
if (this.data.stick == 1) {
wx.pageScrollTo({
duration: 3,
scrollTop: 850,
success: (res) => {},
fail: (res) => {},
complete: (res) => {},
success: (res) => { },
fail: (res) => { },
complete: (res) => { },
})
}
this.getyouzhi()
}else{
} else {
this.setData({
isyouzhi: 1
})
this.getgoodlist()
if(this.data.stick==1){
if (this.data.stick == 1) {
wx.pageScrollTo({
duration: 3,
scrollTop: 700,
success: (res) => {},
fail: (res) => {},
complete: (res) => {},
success: (res) => { },
fail: (res) => { },
complete: (res) => { },
})
}
}
... ... @@ -837,7 +885,7 @@ Page({
}
app.postk(url, param).then((res) => {
wx.hideLoading({
success: (res) => {},
success: (res) => { },
})
if (that.data.page > 1) {
if (res.data.length == 0) {
... ... @@ -854,10 +902,10 @@ Page({
this.setData({
shop_arr: res.data,
})
if(res.data.length==0){
if (res.data.length == 0) {
this.setData({
shop_arr: res.data,
stick:0
stick: 0
})
}
}
... ... @@ -1041,7 +1089,7 @@ Page({
}
}).catch((err) => {})
}).catch((err) => { })
},
// 获取个人信息
... ...
... ... @@ -38,9 +38,11 @@
<view class="tuoyuan">
<image src="/images/tuoyuan.png"></image>
<view class="lunbo_box {{nav_index==0?'boxactive':''}}">
<swiper interval="{{interval}}" duration="{{duration}}" circular="{{circular}}" current='{{current}}' bindchange='swiperChange' autoplay="{{autoplay}}" class='swiper_box'>
<swiper interval="{{interval}}" duration="{{duration}}" circular="{{circular}}"
current='{{current}}' bindchange='swiperChange' autoplay="{{autoplay}}" class='swiper_box'>
<swiper-item class='swiper-item' wx:for="{{imgurl}}" wx:key="index">
<image src='{{item.image}}' mode="aspectFill" data-id="{{item.goods_id}}" data-style="{{item.type}}" data-src="{{item.url}}" catchtap="look_more" />
<image src='{{item.image}}' mode="aspectFill" data-id="{{item.goods_id}}"
data-style="{{item.type}}" data-src="{{item.url}}" catchtap="look_more" />
</swiper-item>
</swiper>
<view class="dots">
... ... @@ -77,12 +79,15 @@
<view class="fenleiitem" bindtap="gonghui">
<image src="/images/img_laobao2.png" mode="widthFix"></image>
</view>
<view class="fenleiitem" bindtap="canban">
<image src="/images/img_laobao-1@2x.png" mode="widthFix"></image>
</view>
<view class="fenleiitem" bindtap="birthday" id="1">
<image src="/images/img_laobao3.png" mode="widthFix"></image>
<image src="/images/img_laobao3@2x.png" mode="widthFix"></image>
</view>
<view class="fenleiitem" bindtap="birthday" id="2">
<!-- <view class="fenleiitem" bindtap="birthday" id="2">
<image src="/images/img_laobao4.png" mode="widthFix"></image>
</view>
</view> -->
</view>
<!-- 新品上线 -->
<view class="huo">
... ... @@ -107,7 +112,8 @@
<view class="newgoodleft" bindtap="seeactive" data-id="{{activity[1].id}}">
<view class="newgoodlefttop">
<view class="newtitle" style="color:{{activity[1].name_color}}">{{activity[1].name}}</view>
<view class="youxuan" style="background:{{activity[1].label_color}}">{{activity[1].label}}</view>
<view class="youxuan" style="background:{{activity[1].label_color}}">{{activity[1].label}}
</view>
</view>
<view class="jiesuo" style="color:{{activity[1].describe_color}}">{{activity[1].describe}}</view>
<view class="newgoodlist">
... ... @@ -213,14 +219,16 @@
</view>
</view> -->
<!-- 品牌推荐列表 -->
<view class="tuijianlist flexone fixedactive" wx:if='{{stick==1}}' >
<view class="tuijianlistitem " wx:for="{{nav_arr}}" wx:key="index" bindtap="select_nav" data-index="{{index}}" data-id="{{item.id}}">
<view class="tuijianlist flexone fixedactive" wx:if='{{stick==1}}'>
<view class="tuijianlistitem " wx:for="{{nav_arr}}" wx:key="index" bindtap="select_nav"
data-index="{{index}}" data-id="{{item.id}}">
<view class="tuijianitemname {{seltui==index?'tuiactive':''}}">{{item.name}}</view>
<view class="tuijiandes {{seltui==index?'tuiactive':''}}">{{item.description}}</view>
</view>
</view>
<view class="tuijianlist flexone" id="tuijianTop">
<view class="tuijianlistitem " wx:for="{{nav_arr}}" wx:key="index" bindtap="select_nav" data-index="{{index}}" data-id="{{item.id}}">
<view class="tuijianlistitem " wx:for="{{nav_arr}}" wx:key="index" bindtap="select_nav"
data-index="{{index}}" data-id="{{item.id}}">
<view class="tuijianitemname {{seltui==index?'tuiactive':''}}">{{item.name}}</view>
<view class="tuijiandes {{seltui==index?'tuiactive':''}}">{{item.description}}</view>
</view>
... ...
... ... @@ -18,7 +18,7 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
onLoad: function (options) {
},
... ... @@ -37,7 +37,7 @@ Page({
},
// 获取验证码
getCodeFun: function() {
getCodeFun: function () {
let t = this;
let AuglyTest_phone = /^1(3|4|5|6|7|8|9)\d{9}$/;
if (t.data.mobile == "") {
... ... @@ -64,7 +64,7 @@ Page({
a.post(url, data, "POST").then((r) => {
if (r.code == "200") {
var num = 60;
var timer = setInterval(function() {
var timer = setInterval(function () {
num--;
if (num <= 0) {
clearInterval(timer);
... ... @@ -82,7 +82,7 @@ Page({
}, 1000);
}
}).catch((err) => {})
}).catch((err) => { })
}
},
... ... @@ -133,9 +133,15 @@ Page({
}
a.post(u, d).then((r) => {
if (r.code == 200) {
a.globalData.index=0
a.globalData.index = 0
let type = wx.getStorageSync('entrance_type');
type == '1'?wx.setStorageSync('login', 1):wx.setStorageSync('gh_login', 1)
if (type == '1') {
wx.setStorageSync('login', 1)
} else if (type == '2') {
wx.setStorageSync('gh_login', 1)
} else if (type == '3') {
wx.setStorageSync('cb_login', 1)
}
wx.showToast({
title: '登录成功',
duration: 1000,
... ... @@ -148,55 +154,55 @@ Page({
}
})
}
}).catch((er) => {})
}).catch((er) => { })
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
... ... @@ -2,13 +2,13 @@
<view class="contaniter">
<view class="title">登录</view>
<view class="item">
<input placeholder="会员编号" maxlength="11" value="{{vipNum}}" bindinput="get_vipNum" class="mobile"/>
<input placeholder="会员编号" maxlength="11" value="{{vipNum}}" bindinput="get_vipNum" class="mobile" />
</view>
<view class="item">
<input placeholder="手机号" maxlength="11" type="number" value="{{mobile}}" bindinput="get_tel" class="mobile"/>
<input placeholder="手机号" maxlength="11" type="number" value="{{mobile}}" bindinput="get_tel" class="mobile" />
</view>
<view class="item" style="margin-top: 24rpx;">
<input placeholder="请输入验证码" maxlength="11" type="number" value="{{code}}" bindinput="get_code" class="code"/>
<input placeholder="请输入验证码" maxlength="11" type="number" value="{{code}}" bindinput="get_code" class="code" />
<view class="get_code" bindtap='getCodeFun' wx:if="{{yes}}">获取验证码</view>
<view class="get_code" wx:else>{{getCode}}</view>
</view>
... ...
... ... @@ -72,7 +72,7 @@ Page({
}).catch((err) => {
if(err.msg=='用户未登录'){
setTimeout(function(){
wx.reLaunch({
wx.navigateTo({
url: '/pages/register/register',
})
},1500)
... ... @@ -329,6 +329,7 @@ Page({
no_login: false
})
t.getInfoFun()
} else {
t.setData({
no_login: true
... ...
... ... @@ -13,49 +13,51 @@ Page({
area: '',
address: '',
cover_type: false,
total:'',
info:{
address:{
address:'',
area:'',
id:'',
tel:'',
name:'',
goods:[]
}
total: '',
info: {
address: {
address: '',
area: '',
id: '',
tel: '',
name: '',
goods: []
},
totalnum:'',
datak:1,
car_ids:[],
user_ticket_id2:'',
user_ticket_id1:'',
coupon:'',
couponone:'',
nouse:'',
obj:'',
type:0,
combo_id:'',
entrance_type:''
goods: {}
},
totalnum: '',
datak: 1,
car_ids: [],
user_ticket_id2: '',
user_ticket_id1: '',
coupon: '',
couponone: '',
nouse: '',
obj: '',
type: 0,
combo_id: '',
entrance_type: '',
copyaddress: '',
},
// 选择优惠券
selectcoupon(e){
let goods=this.data.info.goods;
selectcoupon(e) {
let goods = this.data.info.goods;
console.log(goods)
let arr=[]
goods.forEach(function(value,index,array){
let arr = []
goods.forEach(function (value, index, array) {
arr.push(value.id)
})
let couponid=e.currentTarget.dataset.id;
let couponid = e.currentTarget.dataset.id;
console.log(couponid)
wx.navigateTo({
url: '/pages/lingqucoupon/lingqucoupon?type='+couponid+'&total='+this.data.info.real_total +'&goods_ids='+JSON.stringify(arr)
url: '/pages/lingqucoupon/lingqucoupon?type=' + couponid + '&total=' + this.data.info.real_total + '&goods_ids=' + JSON.stringify(arr)
})
},
// 领取优惠券
lingqucoupon(){
lingqucoupon() {
wx.navigateTo({
url:'/pages/coupon/coupon?type='+2
url: '/pages/coupon/coupon?type=' + 2
})
},
//加减商品数量
... ... @@ -96,7 +98,7 @@ Page({
for (let obj of coudan_arr) {
console.log(obj)
console.log(obj.price2)
if (obj.price2!= null) {
if (obj.price2 != null) {
console.log(111)
choudan_money = (obj.price2 * 100 * obj.num) / 100 + choudan_money
} else {
... ... @@ -107,7 +109,7 @@ Page({
console.log(typeof (choudan_money))
console.log(choudan_money)
this.setData({
choudan_money: choudan_money*100
choudan_money: choudan_money * 100
// choudan_money: Math.floor(choudan_money* 100) / 100
})
},
... ... @@ -171,7 +173,7 @@ Page({
id: id,
num: num,
price: Number(price),
price2:Number(price2)
price2: Number(price2)
})
}
that.setData({
... ... @@ -182,10 +184,10 @@ Page({
that.get_choudan()
},
//获取页面信息
get_info(combo_id,data,address_id,user_ticket_id1,user_ticket_id2) {
get_info(combo_id, data, address_id, user_ticket_id1, user_ticket_id2) {
let that = this
let url = that.data.type == 4 ? app.interface.prev_pay : that.data.type == 3?app.interface.now_prev_pay:'/order/affirm';
if(that.data.type == 3 || that.data.type == 4){
let url = that.data.type == 4 ? app.interface.prev_pay : that.data.type == 3 ? app.interface.now_prev_pay : '/order/affirm';
if (that.data.type == 3 || that.data.type == 4) {
let params = {
info: that.data.params,
address_id: address_id
... ... @@ -199,44 +201,57 @@ Page({
that.setData({
info: res.msg,
total:total
total: total
})
console.log('9988756', that.data.info)
})
}else{
} else {
let params = {
combo_id:combo_id,
data:data,
address_id:address_id,
user_ticket_id1:user_ticket_id1,
user_ticket_id2:user_ticket_id2
combo_id: combo_id,
data: data,
address_id: address_id,
user_ticket_id1: user_ticket_id1,
user_ticket_id2: user_ticket_id2
}
app.postk(url, params).then((res) => {
console.log('99999', res, Number(res.data.total))
let coupon=wx.getStorageSync('coupon');
if(coupon!=''){
let coupon = wx.getStorageSync('coupon');
if (coupon != '') {
this.setData({
coupon:wx.getStorageSync('coupon')
coupon: wx.getStorageSync('coupon')
})
}
let couponone=wx.getStorageSync('couponone');
if(couponone!=''){
let couponone = wx.getStorageSync('couponone');
if (couponone != '') {
this.setData({
couponone:wx.getStorageSync('couponone')
couponone: wx.getStorageSync('couponone')
})
}
console.log(this.data.couponone)
res.data.total = Number(res.data.total * 100)/100
res.data.freight = Number(res.data.freight * 100)/100
res.data.sum_goods_total= Number(res.data.sum_goods_total * 100)/100
res.data.total = Number(res.data.total * 100) / 100
res.data.freight = Number(res.data.freight * 100) / 100
res.data.sum_goods_total = Number(res.data.sum_goods_total * 100) / 100
// let total = (res.msg.total + res.data.yunfei).toFixed("1");
console.log(res.data)
that.setData({
info: res.data,
totalnum:res.data.goods.length
totalnum: res.data.goods.length,
})
let info = that.data.info
console.log(info)
info.address = {}
info.address.address = that.data.copyaddress.address
info.address.area = that.data.copyaddress.area
info.address.id = that.data.copyaddress.id
info.address.tel = that.data.copyaddress.tel
info.address.name = that.data.copyaddress.name
that.setData({
info
})
console.log(info)
console.log('9988756', that.data.info.goods)
}).catch(function (err) {
console.log(err);
... ... @@ -270,34 +285,34 @@ Page({
// })
// },
get_info1(combo_id,data,address_id,user_ticket_id1,user_ticket_id2) {
get_info1(combo_id, data, address_id, user_ticket_id1, user_ticket_id2) {
let that = this
// let url='/order/affirm'
// 判断进入入口
let url = type == 3 ? app.interface.now_prev_pay : app.interface.prev_pay
let params = {
combo_id:combo_id,
data:data,
address_id:address_id,
user_ticket_id1:user_ticket_id1,
user_ticket_id2:user_ticket_id2,
combo_id: combo_id,
data: data,
address_id: address_id,
user_ticket_id1: user_ticket_id1,
user_ticket_id2: user_ticket_id2,
}
app.postk(url, params).then((res) => {
let couponone=wx.getStorageSync('couponone');
if(couponone!=''){
let couponone = wx.getStorageSync('couponone');
if (couponone != '') {
this.setData({
couponone:wx.getStorageSync('couponone')
couponone: wx.getStorageSync('couponone')
})
}
console.log(this.data.couponone)
res.data.total = Number(res.data.total * 100)/100
res.data.freight = Number(res.data.freight * 100)/100
res.data.sum_goods_total= Number(res.data.sum_goods_total * 100)/100
res.data.total = Number(res.data.total * 100) / 100
res.data.freight = Number(res.data.freight * 100) / 100
res.data.sum_goods_total = Number(res.data.sum_goods_total * 100) / 100
// let total = (res.msg.total + res.data.yunfei).toFixed("1");
that.setData({
info: res.data,
totalnum:res.data.goods.length
totalnum: res.data.goods.length
})
console.log('9988756', that.data.info.goods)
}).catch(function (err) {
... ... @@ -314,7 +329,7 @@ Page({
}
app.post(url, params).then((res) => {
that.setData({
"info.yunfei": Number(res.msg.yunfei)*100
"info.yunfei": Number(res.msg.yunfei) * 100
})
})
},
... ... @@ -344,19 +359,19 @@ Page({
if (coudan && coudan.length > 0) {
info = info.concat(coudan)
}
let arr=[];
let arr = [];
arr.push(that.data.obj)
let url = '/order/create_order';
console.log('9998887755',that.data.datak)
let data=that.data.datak
console.log('9998887755', that.data.datak)
let data = that.data.datak
let params = {
combo_id: that.data.combo_id,
data:that.data.datak,
car_ids:that.data.car_ids.join(","),
data: that.data.datak,
car_ids: that.data.car_ids.join(","),
// info: JSON.stringify(info),
address_id:that.data.info.address.id,
user_ticket_id1:that.data.user_ticket_id1,
user_ticket_id2:that.data.user_ticket_id2,
address_id: that.data.info.address.id,
user_ticket_id1: that.data.user_ticket_id1,
user_ticket_id2: that.data.user_ticket_id2,
// data:JSON.stringify(arr),
}
console.log(params)
... ... @@ -371,8 +386,8 @@ Page({
// }
},
//点击支付
submit_score() {
//点击支付
submit_score() {
let that = this;
let list = that.data.info.products
let coudan = that.data.coudan
... ... @@ -407,10 +422,10 @@ submit_score() {
})
that.order_pay_score(res.msg)
})
},
},
//积分商城订单支付
order_pay_score(order_odd) {
//积分商城订单支付
order_pay_score(order_odd) {
let url = app.interface.order_pay
let params = {
order_odd: order_odd
... ... @@ -429,11 +444,11 @@ order_pay_score(order_odd) {
})
}
})
},
},
//开放订单支付
order_pay(order_odd) {
let that=this;
let that = this;
let url = '/order/pay'
let params = {
order_id: order_odd
... ... @@ -453,13 +468,13 @@ order_pay_score(order_odd) {
package: res.package,
signType: res.signType,
paySign: res.paySign,
success: function(res) {
success: function (res) {
console.log(res)
wx.redirectTo({
url: '/pages/order/order_list/order_list?type=' +1+'&statusk='+2,
url: '/pages/order/order_list/order_list?type=' + 1 + '&statusk=' + 2,
})
},
fail: function(res) {
fail: function (res) {
console.log(123);
console.log(res);
}
... ... @@ -468,43 +483,44 @@ order_pay_score(order_odd) {
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
onLoad: function (options) {
if(options.obj){
if (options.obj) {
this.setData({
obj:JSON.parse(options.obj)
obj: JSON.parse(options.obj)
})
}
this.setData({
type: options.type,
entrance_type:wx.getStorageSync('entrance_type'),
entrance_type: wx.getStorageSync('entrance_type'),
params: options.info,
datak:options.info,
datak: options.info,
})
if(options.car_id){
if (options.car_id) {
this.setData({
car_ids:JSON.parse(options.car_id)
car_ids: JSON.parse(options.car_id)
})
}
console.log('343购物车id',this.data.car_ids)
this.get_info('', options.info, '','','')
console.log('343购物车id', this.data.car_ids)
this.get_info('', options.info, '', '', '')
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
onShow: function () {
let pages = getCurrentPages();
let currPage = pages[pages.length - 1]
console.log('887766554',this.data.params)
console.log('887766554', this.data.params)
console.log(currPage.data)
if (currPage.data.id) {
this.setData({
"info.address.address": currPage.data.address,
... ... @@ -512,16 +528,23 @@ order_pay_score(order_odd) {
"info.address.id": currPage.data.id,
"info.address.tel": currPage.data.tel,
"info.address.name": currPage.data.name,
copyaddress: {
address: currPage.data.address,
area: currPage.data.area,
id: currPage.data.id,
tel: currPage.data.tel,
name: currPage.data.name,
}
})
// this.get_youfei(currPage.data.user_ticket_id1)
}
console.log(this.data.info.address.address)
this.setData({
user_ticket_id1:currPage.data.user_ticket_id1
user_ticket_id1: currPage.data.user_ticket_id1
})
this.get_info('', this.data.params, currPage.data.id,currPage.data.user_ticket_id1,currPage.data.user_ticket_id2)
this.get_info('', this.data.params, currPage.data.id, currPage.data.user_ticket_id1, currPage.data.user_ticket_id2)
// if (currPage.data.user_ticket_id2) {
// console.log(66666,this.data.params)
... ... @@ -541,35 +564,35 @@ order_pay_score(order_odd) {
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
<view class="content">
<!-- 地址信息 -->
<view class="address_box" wx:if="{{info.address}}" bindtap="add_address">
<view class="address_box" wx:if="{{info.address.address}}" bindtap="add_address">
<view class="name"> {{info.address.name}}
<text>{{info.address.mobile}}</text>
</view>
... ...
... ... @@ -55,8 +55,17 @@ Page({
encryptedData: e.detail.encryptedData
})
if(that.data.iv){
wx.login({
success: function(r) {
that.setData({
code: r.code
})
that.get_token()
}
})
}
}
},
... ... @@ -84,6 +93,7 @@ Page({
// wx.setStorageSync('token', 'C9c4f9e702e05dae61d854c0c2dd6e21a');
wx.setStorageSync('login', r.new_login);
wx.setStorageSync('gh_login', r.gh_login);
wx.setStorageSync('cb_login', r.cb_login);
// wx.setStorageSync('tel', r.tel);
// wx.reLaunch({
// url: '/pages/index/index'
... ...
... ... @@ -2,7 +2,8 @@ page {
background: #F9F9F9;
padding-bottom: 100rpx;
}
.no_login{
.no_login {
font-size: 36rpx;
font-family: PingFang SC;
font-weight: 400;
... ... @@ -10,12 +11,13 @@ page {
margin-top: 200rpx;
text-align: center;
}
.content {
width: 100%;
padding: 30rpx 32rpx;
box-sizing: border-box;
background: #f9f9f9;
margin-bottom:120rpx;
margin-bottom: 120rpx;
}
.empty {
... ... @@ -44,21 +46,25 @@ page {
justify-content: space-between;
align-items: center;
}
.footer .check_box {
display: flex;
align-items: center;
}
.footer .check_box .check {
width: 36rpx;
height: 36rpx;
padding: 20rpx 20rpx 20rpx 0;
}
.footer .check_box .text {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(19, 26, 46, 1);
}
.tips_info text:first-child {
font-size: 26rpx;
font-family: PingFang SC;
... ... @@ -86,19 +92,22 @@ page {
justify-content: center;
align-items: center;
}
.delname{
color:rgba(242, 0, 0, 1);
.delname {
color: rgba(242, 0, 0, 1);
font-size: 28rpx;
text-align: right;
}
.editname{
color:#333;
.editname {
color: #333;
font-size: 28rpx;
}
.edittop{
display:flex;
.edittop {
display: flex;
justify-content: space-between;
align-items: center;
padding: 32rpx;
... ...
... ... @@ -10,6 +10,7 @@ Page({
current: 0,
status: 0,
nav: ['商品介绍', '规格参数', '售后保障'],
// nav: ['商品介绍', '规格参数'],
mask: false,
cartnum:'',
speclist:[],
... ...
... ... @@ -130,6 +130,7 @@ page {
height: 88rpx;
display: flex;
display: -webkit-flex;
justify-content: space-around;
}
.three_one_item {
... ...
... ... @@ -4,19 +4,19 @@
"ignore": []
},
"setting": {
"urlCheck": true,
"urlCheck": false,
"es6": true,
"enhance": true,
"enhance": false,
"postcss": true,
"preloadBackgroundData": false,
"minified": true,
"newFeature": true,
"newFeature": false,
"coverView": true,
"nodeModules": false,
"autoAudits": false,
"showShadowRootInWxmlPanel": true,
"scopeDataCheck": false,
"uglifyFileName": true,
"uglifyFileName": false,
"checkInvalidKey": true,
"checkSiteMap": true,
"uploadWithSourceMap": true,
... ... @@ -32,7 +32,7 @@
"enableEngineNative": false,
"bundle": false,
"useIsolateContext": true,
"useCompilerModule": false,
"useCompilerModule": true,
"userConfirmedUseCompilerModuleSwitch": false,
"userConfirmedBundleSwitch": false,
"packNpmManually": false,
... ...