作者 倪静楠

20201211

正在显示 61 个修改的文件 包含 718 行增加1158 行删除
... ... @@ -3,27 +3,15 @@ let utils = require("../../utils/util.js")
let method = require("../../utils/reuqest.js")
const app = getApp()
Component({
/**
* 组件的属性列表
*/
/**
* 组件的初始数据
*/
data: {
list:[], //时间数组
deliveryTime: "",
selfData: [], //自提日期
showDelivery: false,
deliveryTimeList: [{
day: "",
timeList: ""
}],
list: [], //自提时间数组
nowDay: 0,
selectTime: '',
selectTime: '', //自提时间
selectTimeIndex: '',
selectDay: 0,
timeLists: ''
},
pageLifetimes: {
show: function () {
... ... @@ -42,36 +30,35 @@ Component({
lifetimes: {
created() {
let _this = this;
if(_this.data.nowDay==0){
if (_this.data.nowDay == 0) {
method.getRequest("/myUser/period/" + '1', data => {
//let list=this
if (data.statusCode == 0) {
_this.setData({
list:data.data
list: data.data
})
}
console.log(_this.data.nowDay,'now')
console.log(_this.data.nowDay, 'now')
console.log(_this.data.deliveryTimeList, 'list')
})
}else{
} else {
method.getRequest("/myUser/period/" + '2', data => {
//let list=this
if (data.statusCode == 0) {
_this.setData({
list:data.data
list: data.data
})
}
console.log(_this.data.nowDay,'now')
console.log(_this.data.nowDay, 'now')
console.log(_this.data.deliveryTimeList, 'list')
})
}
},
attached() {
console.log("在组件实例进入页面节点树时执行")
},
ready() {
console.log("在组件在视图层布局完成后执行")
},
moved() {
... ... @@ -83,60 +70,43 @@ Component({
error() {
console.log("每当组件方法抛出错误时执行")
},
/*组件所在页面的生命周期 */
pageLifetimes: {
show: function () {
// 页面被展示
console.log("页面被展示")
},
hide: function () {
// 页面被隐藏
console.log("页面被隐藏")
},
resize: function (size) {
// 页面尺寸变化
console.log("页面尺寸变化")
}
}
},
methods: {
getnowDay(e) {
this.setData({
nowDay: e.currentTarget.dataset.index
})
console.log(this.data.nowDay,'nowday')
console.log(this.data.nowDay, 'nowday')
let _this = this;
if(_this.data.nowDay==0){
if (_this.data.nowDay == 0) {
method.getRequest("/myUser/period/" + '1', data => {
//let list=this
if (data.statusCode == 0) {
_this.setData({
list:data.data
list: data.data
})
}
console.log(_this.data.nowDay,'now')
console.log(_this.data.nowDay, 'now')
console.log(_this.data.deliveryTimeList, 'list')
})
}else{
} else {
method.getRequest("/myUser/period/" + '2', data => {
//let list=this
if (data.statusCode == 0) {
_this.setData({
list:data.data
list: data.data
})
}
console.log(_this.data.nowDay,'now')
console.log(_this.data.nowDay, 'now')
console.log(_this.data.deliveryTimeList, 'list')
})
}
},
clickTime(e) {
let selfData = this.data.selfData[this.data.nowDay]
let id= e.currentTarget.dataset.id;
let index= e.currentTarget.dataset.index;
let id = e.currentTarget.dataset.id;
let index = e.currentTarget.dataset.index;
let _this = this;
// let selectTime = this.data.deliveryTimeList[this.data.nowDay].timeList[index]
let deliveryTime = selfData.year + '-' + selfData.month + '-' + selfData.day + ' '
let deliveryTime = selfData.year + '-' + selfData.month + '-' + selfData.day + ' '
let nowDay = this.data.nowDay
this.setData({
selectTimeIndex: index,
... ... @@ -144,15 +114,16 @@ Component({
deliveryTime: deliveryTime,
selectDay: nowDay
})
// this.triggerEvent('selectTime', {
// deliveryTime: this.data.deliveryTime
// })
this.data.list.map((item,index)=>{
if(item.id === id){
this.data.list.map((item, index) => {
if (item.id === id) {
let times = item.start + '-' + item.end
_this.triggerEvent('selectTime',{time : times,flag : false,timeId:item.id,deliveryTime:this.data. deliveryTime})
//_this.triggerEvent('showTime',false)
wx.setStorageSync('selecClick',true)
_this.triggerEvent('selectTime', {
time: times,
flag: false,
timeId: item.id,
deliveryTime: this.data.deliveryTime
})
wx.setStorageSync('selecClick', true)
}
})
},
... ... @@ -166,63 +137,62 @@ Component({
})
//获取时间段
let timeDate = new Date(date.getTime());
let todayList = getTimeList(timeDate.getHours(), 1);
deliveryTimeList.push({
timeList: todayList
});
let nextDayList = getTimeList(9, 0);
for (let i = 1; i < 5; i++) {
deliveryTimeList.push({
timeList: nextDayList
});
}
this.triggerEvent('selectTime', {
deliveryTime: this.data.deliveryTime
})
this.setData({
deliveryTimeList: []
})
this.setData({
deliveryTimeList: deliveryTimeList
})
// let todayList = getTimeList(timeDate.getHours(), 1);
// deliveryTimeList.push({
// timeList: todayList
// });
// let nextDayList = getTimeList(9, 0);
// for (let i = 1; i < 5; i++) {
// deliveryTimeList.push({
// timeList: nextDayList
// });
// }
// this.triggerEvent('selectTime', {
// deliveryTime: this.data.deliveryTime
// })
// this.setData({
// deliveryTimeList: []
// })
// this.setData({
// deliveryTimeList: deliveryTimeList
// })
//获取时间段
// today 1 是今天 0 不是今天
function getTimeList(hour, today) {
let timeList = [];
// let startTime = hour <= 9 ? 9 : hour;
// for (let i = 0; i < 8; i++) {
// if (((hour <= 9) && (startTime + 2 * i >21)) || ((hour > 9) && (startTime + 2 * i >= 21))) {
// break;
// } else {
// if (hour <= 9) {
// timeList.push(
// startTime + 2 * i + ":00" + "-" + (startTime + 2 * (i + 1)) + ":00"
// );
// } else {
// if (startTime % 2 === 0) {
// timeList.push(
// startTime + 2 * i + 1 + ":00" + "-" + (startTime + 2 * i + 3) + ":00"
// );
// } else {
// console.log(i,'i')
// timeList.push(
// startTime + 2 * i +2 + ":00" + "-" + (startTime + 2 * i + 4) + ":00"
// );
// }
// }
// }
// }
method.getRequest("/myUser/period/" + '1', data => {
if (data.statusCode == 0) {
that.setData({
deliveryTimeList: data.data
})
timeList = data.data
}
console.log(timeList, 'list')
})
return timeList;
}
// function getTimeList(hour, today) {
// let timeList = [];
// // let startTime = hour <= 9 ? 9 : hour;
// // for (let i = 0; i < 8; i++) {
// // if (((hour <= 9) && (startTime + 2 * i >21)) || ((hour > 9) && (startTime + 2 * i >= 21))) {
// // break;
// // } else {
// // if (hour <= 9) {
// // timeList.push(
// // startTime + 2 * i + ":00" + "-" + (startTime + 2 * (i + 1)) + ":00"
// // );
// // } else {
// // if (startTime % 2 === 0) {
// // timeList.push(
// // startTime + 2 * i + 1 + ":00" + "-" + (startTime + 2 * i + 3) + ":00"
// // );
// // } else {
// // console.log(i,'i')
// // timeList.push(
// // startTime + 2 * i +2 + ":00" + "-" + (startTime + 2 * i + 4) + ":00"
// // );
// // }
// // }
// // }
// // }
// method.getRequest("/myUser/period/" + '1', data => {
// if (data.statusCode == 0) {
// that.setData({
// deliveryTimeList: data.data
// })
// timeList = data.data
// }
// })
// return timeList;
// }
}
}
})
\ No newline at end of file
... ...
<!--components/time-picker/time-picker.wxml-->
<!--component/time-picker/index.wxml-->
<view class="select-date">
<view class="time-title">自提时间</view>
<view class="select-day">
... ... @@ -15,27 +14,5 @@
</view>
<view wx:else class="time-title">对不起,今日暂无自提时间
</view>
<!-- <view class="select-time">
<view wx:if="{{nowDay===0}}">
<view wx:if='{{deliveryTimeList.length>0}}'> -->
<!-- <view wx:if='{{timeLists.length}}'> -->
<!-- <view class='{{index===selectTimeIndex&&nowDay===selectDay?"select-time-item select":"select-time-item"}}'
wx:for="timeLists" bindtap="clickTime" wx:key="index" data-index='{{index}}'>
{{item.start}}
</view> -->
<!-- <view class='{{index===selectTimeIndex&&nowDay===selectDay?"select-time-item select":"select-time-item"}}'
wx:for="{{deliveryTimeList[nowDay].timeList}}" bindtap="clickTime" wx:key="index" data-index='{{index}}'>
{{item}}
</view> -->
<!-- </view>
</view>
<view wx:if="{{nowDay!==0}}">
<view class='{{index===selectTimeIndex&&nowDay===selectDay?"select-time-item select":"select-time-item"}}'
wx:for="{{deliveryTimeList[nowDay].timeList}}" bindtap="clickTime" wx:key="index" data-index='{{index}}'>
{{item}}
</view>
</view>
</view> -->
<!-- </view> -->
</view>
\ No newline at end of file
... ...

1.8 KB | 宽: | 高:

996 字节 | 宽: | 高:

  • 两方对比
  • 交换覆盖
  • 透明覆盖

169.9 KB | 宽: | 高:

29.0 KB | 宽: | 高:

  • 两方对比
  • 交换覆盖
  • 透明覆盖
@import '../common/index.wxss';.van-field{--cell-icon-size:16px;--cell-icon-size:var(--field-icon-size,16px)}.van-field__label{color:#646566;color:var(--field-label-color,#646566)}.van-field__label--disabled{color:#c8c9cc;color:var(--field-disabled-text-color,#c8c9cc)}.van-field__body{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center}.van-field__body--textarea{padding:3.6px 0;line-height:1.2em}.van-field__body--textarea,.van-field__input{box-sizing:border-box;min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__input{position:relative;display:block;width:100%;margin:0;padding:0;line-height:inherit;text-align:left;background-color:initial;border:0;resize:none;color:#323233;color:var(--field-input-text-color,#323233);height:24px;height:var(--cell-line-height,24px)}.van-field__input--textarea{height:18px;height:var(--field-text-area-min-height,18px);min-height:18px;min-height:var(--field-text-area-min-height,18px)}.van-field__input--error{color:#ee0a24;color:var(--field-input-error-text-color,#ee0a24)}.van-field__input--disabled{background-color:initial;opacity:1;color:#c8c9cc;color:var(--field-input-disabled-text-color,#c8c9cc)}.van-field__input--center{text-align:center}.van-field__input--right{text-align:right}.van-field__placeholder{position:absolute;top:0;right:0;left:0;pointer-events:none;color:#c8c9cc;color:var(--field-placeholder-text-color,#c8c9cc)}.van-field__placeholder--error{color:#ee0a24;color:var(--field-error-message-color,#ee0a24)}.van-field__icon-root{display:-webkit-flex;display:flex;-webkit-align-items:center;align-items:center;min-height:24px;min-height:var(--cell-line-height,24px)}.van-field__clear-root,.van-field__icon-container{line-height:inherit;vertical-align:middle;padding:0 8px;padding:0 var(--padding-xs,8px);margin-right:-8px;margin-right:-var(--padding-xs,8px)}.van-field__button,.van-field__clear-root,.van-field__icon-container{-webkit-flex-shrink:0;flex-shrink:0}.van-field__clear-root{font-size:16px;font-size:var(--field-clear-icon-size,16px);color:#c8c9cc;color:var(--field-clear-icon-color,#c8c9cc)}.van-field__icon-container{font-size:16px;font-size:var(--field-icon-size,16px);color:#969799;color:var(--field-icon-container-color,#969799)}.van-field__icon-container:empty{display:none}.van-field__button{padding-left:8px;padding-left:var(--padding-xs,8px)}.van-field__button:empty{display:none}.van-field__error-message{text-align:left;font-size:12px;font-size:var(--field-error-message-text-font-size,12px);color:#ee0a24;color:var(--field-error-message-color,#ee0a24)}.van-field__error-message--center{text-align:center}.van-field__error-message--right{text-align:right}.van-field__word-limit{text-align:right;margin-top:4px;margin-top:var(--padding-base,4px);color:#646566;color:var(--field-word-limit-color,#646566);font-size:12px;font-size:var(--field-word-limit-font-size,12px);line-height:16px;line-height:var(--field-word-limit-line-height,16px)}.van-field__word-num{display:inline}.van-field__word-num--full{color:#ee0a24;color:var(--field-word-num-full-color,#ee0a24)}
\ No newline at end of file
@import '../common/index.wxss';
.van-field {
--cell-icon-size: 16px;
--cell-icon-size: var(--field-icon-size, 16px);
margin-bottom: 20rpx;
}
.van-field__label {
color: #646566;
color: var(--field-label-color, #646566)
}
.van-field__label--disabled {
color: #c8c9cc;
color: var(--field-disabled-text-color, #c8c9cc)
}
.van-field__body {
display: -webkit-flex;
display: flex;
-webkit-align-items: center;
align-items: center
}
.van-field__body--textarea {
padding: 3.6px 0;
line-height: 1.2em
}
.van-field__body--textarea,
.van-field__input {
box-sizing: border-box;
min-height: 24px;
min-height: var(--cell-line-height, 24px)
}
.van-field__input {
position: relative;
display: block;
width: 100%;
margin: 0;
padding: 0;
line-height: inherit;
text-align: left;
background-color: initial;
border: 0;
resize: none;
color: #323233;
color: var(--field-input-text-color, #323233);
height: 24px;
height: var(--cell-line-height, 24px)
}
.van-field__input--textarea {
height: 18px;
height: var(--field-text-area-min-height, 18px);
min-height: 18px;
min-height: var(--field-text-area-min-height, 18px)
}
.van-field__input--error {
color: #ee0a24;
color: var(--field-input-error-text-color, #ee0a24)
}
.van-field__input--disabled {
background-color: initial;
opacity: 1;
color: #c8c9cc;
color: var(--field-input-disabled-text-color, #c8c9cc)
}
.van-field__input--center {
text-align: center
}
.van-field__input--right {
text-align: right
}
.van-field__placeholder {
position: absolute;
top: 0;
right: 0;
left: 0;
pointer-events: none;
color: #c8c9cc;
color: var(--field-placeholder-text-color, #c8c9cc)
}
.van-field__placeholder--error {
color: #ee0a24;
color: var(--field-error-message-color, #ee0a24)
}
.van-field__icon-root {
display: -webkit-flex;
display: flex;
-webkit-align-items: center;
align-items: center;
min-height: 24px;
min-height: var(--cell-line-height, 24px)
}
.van-field__clear-root,
.van-field__icon-container {
line-height: inherit;
vertical-align: middle;
padding: 0 8px;
padding: 0 var(--padding-xs, 8px);
margin-right: -8px;
margin-right: -var(--padding-xs, 8px)
}
.van-field__button,
.van-field__clear-root,
.van-field__icon-container {
-webkit-flex-shrink: 0;
flex-shrink: 0
}
.van-field__clear-root {
font-size: 16px;
font-size: var(--field-clear-icon-size, 16px);
color: #c8c9cc;
color: var(--field-clear-icon-color, #c8c9cc)
}
.van-field__icon-container {
font-size: 16px;
font-size: var(--field-icon-size, 16px);
color: #969799;
color: var(--field-icon-container-color, #969799)
}
.van-field__icon-container:empty {
display: none
}
.van-field__button {
padding-left: 8px;
padding-left: var(--padding-xs, 8px)
}
.van-field__button:empty {
display: none
}
.van-field__error-message {
text-align: left;
font-size: 12px;
font-size: var(--field-error-message-text-font-size, 12px);
color: #ee0a24;
color: var(--field-error-message-color, #ee0a24)
}
.van-field__error-message--center {
text-align: center
}
.van-field__error-message--right {
text-align: right
}
.van-field__word-limit {
text-align: right;
margin-top: 4px;
margin-top: var(--padding-base, 4px);
color: #646566;
color: var(--field-word-limit-color, #646566);
font-size: 12px;
font-size: var(--field-word-limit-font-size, 12px);
line-height: 16px;
line-height: var(--field-word-limit-line-height, 16px)
}
.van-field__word-num {
display: inline
}
.van-field__word-num--full {
color: #ee0a24;
color: var(--field-word-num-full-color, #ee0a24)
}
\ No newline at end of file
... ...
... ... @@ -7,15 +7,14 @@ Page({
username: '',
phone: '',
value: '',
checked: 0,
checked: 0, //是否默认
show: false,
selectBox: true,
location: '',
latitude: "",
location: '', //解析地址
latitude: "", //收货地址
longitude: "",
latitudes: "", //传值
longitudes: "",
flag: true
latitudes: "", //传参
longitudes: ""
},
//姓名
inputName(e) {
... ... @@ -94,7 +93,6 @@ Page({
wx.getLocation({
type: 'gcj02',
success(res) {
console.log(res, 'rs')
const location = JSON.stringify({
latitude: res.latitude,
longitude: res.longitude
... ... @@ -167,9 +165,6 @@ Page({
title: '保存成功',
icon: 'none'
})
// wx.redirectTo({
// url: '/pages/select-address/select-address?edit=1',
// })
wx.navigateBack({
delta: 1,
})
... ... @@ -197,7 +192,6 @@ Page({
onShow: function () {
let that = this;
const location = chooseLocation.getLocation();
console.log(location, 'location')
const address = location.address
const latitude = location.latitude
const longitude = location.longitude
... ...
<!--pages/add-address/add-address.wxml-->
<view class="container">
<van-cell-group class="addContent">
<van-field value="{{ username }}" label="姓名" icon="question-o" placeholder="请输入姓名"
bind:click-icon="onClickIcon" bindinput="inputName" />
<van-field value="{{ username }}" label="姓名" icon="question-o" placeholder="请输入姓名" bind:click-icon="onClickIcon"
bindinput="inputName" />
<van-field value="{{ phone }}" label="电话" placeholder="请输入电话" bindinput="inputDel" bindblur="blurPhone" />
<view class="location" catchtap="map">
<text style="width:200rpx">收货地址</text>
<text class="locationItem">{{location}}</text>
</view>
<!-- </van-cell> -->
<van-popup show="{{ show }}" bind:close="onClose" position="bottom" custom-style="height: 30%">
<van-area area-list="{{ areaList }}" value="area" columns-placeholder="{{ ['请选择', '请选择', '请选择'] }}"
bind:change="changeAddress" bind:confirm="chooseAddress" bind:cancel="cancelChoose">{{city}}</van-area>
</van-popup>
<van-field value="{{ value }}" label="详细地址" placeholder="请输入详细地址" bindinput="inputAddress" />
</van-cell-group>
<!-- 默认地址 -->
<view class="defaultAddress">
<view class="defaultText">设为默认地址</view>
... ...
... ... @@ -3,12 +3,6 @@
width: 0;
}
.container {
width: 750rpx;
height: 1624rpx;
background-color: #f1f2f4;
}
.addContent {
background-color: #ffffff;
}
... ... @@ -36,7 +30,7 @@
.location {
background-color: #ffffff;
height: 83rpx;
margin-bottom: 16rpx;
margin-bottom: 20rpx;
margin-top: 16rpx;
display: flex;
align-items: center;
... ... @@ -45,22 +39,6 @@
color: var(--field-label-color, #646566);
}
/* .address {
position: relative;
}
.address .arrow {
position: absolute;
top: 26rpx;
right: 32rpx;
width: 24rpx;
height: 24rpx;
}
.address .arrow image {
width: 24rpx;
height: 24rpx;
} */
/* 默认地址 */
.defaultAddress {
... ...
... ... @@ -3,54 +3,37 @@ let method = require("../../utils/reuqest.js");
const util = require("../../utils/util.js");
Page({
data: {
userData: "",
maxlength: 50,
startTime: '',
cartList: [{
url: '/images/1.jpg',
name: '鲜切泰国桃子',
detail: '果肉饱满,香甜可口',
price: '25'
}],
goodsData: '',
userData: "", //收货地址
id: '', //收货地址id
goodsData: '', //商品信息
show: false,
// currentDate: '12:00',
// currentDateTwo: '13:00',
date: '',
minHour: 1,
maxHour: 23,
maxlength: 50, //留言
length: 0,
leavaWord: '',
// discountText: '满3减1满3减1',
allMoney: '4.00',
giveFee: '8.00',
id: '',
skuId: '',
orderId: '', //普通商品
orderjfId: '', //积分商品
couponId: '', //优惠券
orderId: '', //普通商品Id
orderjfId: '', //积分商品Id
couponId: '', //优惠券Id
cardData: '',
type: "",
cardAmount: '',
amount: '', //满减
count: '',
stockNum: '',
resposeData: '',
discountText: '',
type: "", //优惠券类型
cardAmount: '', //减优惠券金额
amount: '', //满优惠券金额
// count: '',
stockNum: '', //商品库存
discountText: '', //无门槛优惠券金额
payment: '',
// storePickupTime:''
deliveryTime: '', //配送时间年月
timers: '', // 配送时间
timerId: ''
timers: '', //配送时间
resposeData: '', //支付
},
//选择时间
//选择配送时间
selectTime(e) {
console.log(e, 'e')
if (e.detail.time && e.detail.time !== this.data.timers) {
this.setData({
timers: e.detail.time,
// showTime: e.detail.flag,
deliveryTime:e.detail.deliveryTime,
deliveryTime: e.detail.deliveryTime,
showTime: false,
timerId: e.detail.timerId
})
... ... @@ -68,23 +51,12 @@ Page({
this.setData({
showTime: true
})
// this.timepicker.getDliveryTime();
},
onClickButton() {
this.setData({
showModal: true
})
},
getDayTime() {
var myDate = new Date();
var year = myDate.getFullYear();
var month = myDate.getMonth();
var day = myDate.getDate();
var dayNow = year + '-' + (month + 1) + "-" + day;
this.setData({
startTime: dayNow
})
},
//选择地址
getAddress() {
let index = wx.getStorageSync('addIndex')
... ... @@ -94,9 +66,10 @@ Page({
userData: data.data[index],
})
} else {
// setTimeout(() => {
// util.getUser()
// }, 2000)
wx.showToast({
title: data.msg,
icon: 'none'
})
}
})
},
... ... @@ -105,20 +78,6 @@ Page({
url: '/pages/select-address/select-address'
})
},
//选择时间
ectTime() {
this.bindStartTimeChange()
},
bindStartTimeChange: function (e) {
this.setData({
startTime: e.detail.value
})
},
bindEndTimeChange: function (e) {
this.setData({
endTime: e.detail.value
})
},
//商品信息
getList() {
let postData = {
... ... @@ -210,20 +169,26 @@ Page({
url: '/pages/my-discount-card/my-discount-card',
})
},
//商品-生成订单
creatOrder() {
//立即购买
creatOrder: util.throttle(function () {
if (this.data.userData == undefined) {
wx.showToast({
title: '请选择收货地址',
icon: 'none'
})
return false;
} else if (this.data.timers == '') {
wx.showToast({
title: '请选择配送时间',
icon: 'none'
})
return false;
} else {
setTimeout(() => {
let postData = {
addressId: this.data.userData.id,
couponId: this.data.couponId,
deliveryTime: this.data.storePickupTime+this.data.timers,
deliveryTime: this.data.deliveryTime + this.data.timers,
note: this.data.leavaWord,
num: this.data.count,
skuId: this.data.skuId
... ... @@ -248,10 +213,11 @@ Page({
wx.setStorageSync('cardAmount', "")
}, 1000)
}
},
}, 3000),
//支付
payment() {
let obj = {}
let _this = this;
method.postRequest("/payment/payment/" + this.data.orderId, obj, data => {
if (data.statusCode == 0) {
this.setData({
... ... @@ -272,23 +238,18 @@ Page({
})
},
'fail': function (res) {
wx.setStorageSync('orderId', this
.data.orderId)
wx.redirectTo({
url: '/pages/order-detail/order-detail'
console.log(_this.data.orderId)
wx.reLaunch({
url: '/pages/order-detail/order-detail?orderId=' + _this.data.orderId,
})
},
'complete': function (res) {}
})
} else {
// setTimeout(() => {
// util.getUser()
// }, 2000)
}
} else {}
})
},
//立即兑换
change() {
change: util.throttle(function () {
if (this.data.userData == undefined) {
wx.showToast({
title: '请选择收货地址',
... ... @@ -320,16 +281,11 @@ Page({
title: data.msg,
icon: 'none'
})
// setTimeout(() => {
// util.getUser()
// }, 2000)
}
})
}
},
}, 3000),
onLoad: function (options) {
console.log(this.data.type == '' ? 'true' : 'fasle', 'types')
this.setData({
addressId: options.id
})
... ... @@ -356,10 +312,6 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
let cardId = wx.getStorageSync('cardId')
this.setData({
couponId: cardId
})
this.getAddress();
//优惠券
let cardIds = wx.getStorageSync('cardId');
... ... @@ -375,7 +327,6 @@ Page({
wx.removeStorageSync('cardId');
wx.removeStorageSync('type');
wx.removeStorageSync('amount');
this.getDayTime() //获取当天时间
this.getList()
},
... ...
... ... @@ -12,24 +12,22 @@
请选择收货地址
</view>
<view class="arrow">
<image src="/images/04-01/arrow.png"></image>
<image src="/images/04-01/arrow.png" mode="aspectFill"></image>
</view>
</view>
<!-- 配送时间 -->
<view class="timeBox" >
<view class="timeBox">
<view style="width:95%;display:flex" bindtap='chooseTime'>
<view class="calendar " wx:if="{{storePickupTime==''}}">
<view class="calendar " wx:if="{{storePickupTime==''}}">
请选择配送时间:
</view>
<view class="calendar1 " wx:if="{{storePickupTime!==''}}">
配送时间:
</view>
<view class="selectText">{{timers.length ? timers : ''}}</view>
<view class="selectText">{{timers.length ? timers : ''}}</view>
</view>
<view class="arrow" bindtap='chooseTime'>
<image src="/images/04-01/arrow.png"></image>
<image src="/images/04-01/arrow.png" mode="aspectFill"></image>
</view>
<view class="section">
<van-popup show="{{ showTime }}" bind:close="onClose" position="bottom">
... ... @@ -39,30 +37,21 @@
</view>
<!-- 商品列表 -->
<view class="cartList">
<view class="cartListItem" wx:for="{{cartList}}">
<!-- <view class="itemLeft">
<view data-type="{{checkType}}" bindtap="checkEvent" data-index="{{index}}">
<image src="/images/04-01/uncheck.png" wx:if="{{checkType==1}}"></image>
<image src="/images/04-01/check.png" wx:if="{{checkType==0}}"></image>
</view>
</view> -->
<view class="cartListItem" >
<view class="itemRight">
<view class="productPic">
<image src="{{goodsData.goodsImg}}"></image>
<image src="{{goodsData.goodsImg}}" mode="aspectFill"></image>
</view>
<view style="width:381rpx">
<view class="productName">{{goodsData.goodsName}}</view>
<view class="productDetail">{{goodsData.goodsAttributes}}</view>
<view class="productPrice">
<view class="price">¥{{goodsData.goodsPrice}}</view>
<view class="price">
<text class="moneyIcon">¥</text>
<text class="moneyNum">{{goodsData.goodsPrice}}</text>
</view>
<view class="num">
<!-- <view class="reduce" catchtap="dec">
<image src="/images/04-01/reduce.png"></image>
</view> -->
<view class="numContent">x{{count}}</view>
<!-- <view class="add" catchtap="add">
<image src="/images/04-01/add.png"></image>
</view> -->
</view>
</view>
</view>
... ... @@ -72,20 +61,19 @@
<!-- 买家留言 -->
<view class="messageBox">
<view class="messageTitle">买家留言:</view>
<textarea name="" id="" cols="30" rows="10" value="{{content}}" placeholder="留言建议提前协商50字之内"
maxlength="{{maxlength}}" bindinput="userInput"></textarea>
<textarea cols="30" rows="10" value="{{content}}" placeholder="留言建议提前协商50字之内" maxlength="{{maxlength}}"
bindinput="userInput"></textarea>
<view class="numLength">{{length}}/50</view>
</view>
<!-- 优惠券 -->
<view class="discountCard" wx:if="{{goodsData.type==2}}">
<view>优惠券</view>
<view class="discountBox" bindtap="goCardList">
<!-- <view class="discountText" wx:if="{{type==0}}">无门槛使用{{}}</view> -->
<view class="discountText" wx:if="{{type==' '}}">{{}}</view>
<view class="discountText" wx:if="{{type===1}}">满{{amount}}减{{cardAmount}}</view>
<view class="discountText" wx:if="{{type===0}}">无门槛{{discountText}}元优惠券</view>
<view class="arrowRight">
<image src="/images/04-01/arrow.png"></image>
<image src="/images/04-01/arrow.png" mode="aspectFill"></image>
</view>
</view>
</view>
... ...
... ... @@ -121,8 +121,8 @@ page {
width: 5%;
}
.arrow image{
width: 24rpx;
height: 32rpx;
width: 20rpx;
height: 24rpx;
}
.timeBox {
width: 686rpx;
... ... @@ -150,6 +150,16 @@ page {
/* 商品列表 */
.moneyIcon{
font-size: 36rpx;
color: #FF1717;
margin-right: -10rpx;
}
.moneyNum{
font-size: 36rpx;
font-weight: 500;
color: #FF1717;
}
.cartList {
width: 686rpx;
margin: 0 auto;
... ... @@ -199,7 +209,6 @@ page {
.productPic {
width: 180rpx;
height: 180rpx;
background-color: azure;
margin-right: 24rpx;
}
... ... @@ -212,7 +221,7 @@ page {
width: 320rpx;
height: 40rpx;
font-size: 28rpx;
font-weight: 500;
font-weight: 600;
text-align: left;
color: #333333;
line-height: 40rpx;
... ...
... ... @@ -2,10 +2,10 @@
let method = require("../../utils/reuqest.js")
Page({
data: {
list:[],
goodsId: '',
list: [], //评价列表
goodsId: '', //商品id
page: 1,
bottomHint: false
bottomHint: false //触底提示
},
//评价列表
getList(goodsId) {
... ... @@ -27,10 +27,10 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
goodsId:options.goodsid
})
this.getList(options.goodsid)
this.setData({
goodsId: options.goodsid
})
this.getList(options.goodsid)
},
/**
... ... @@ -68,7 +68,7 @@ Page({
// wx.showNavigationBarLoading();
this.setData({
page: 1,
list:[]
list: []
})
this.getList()
},
... ...
... ... @@ -2,23 +2,23 @@
<view class="outerBox" wx:for="{{list}}">
<view class="userBox">
<view class="wxHead" wx:if="{{item.anonymous==0}}">
<image src="{{item.wxHeadImg}}"></image>
<image src="{{item.wxHeadImg}}" mode="aspectFill"></image>
</view>
<view class="wxHead" wx:if="{{item.anonymous==1}}">
<image src="/images/nimingtouxiang.png"> </image>
<image src="/images/nimingtouxiang.png" mode="aspectFill"> </image>
</view>
<view class="wxName">{{item.wxName}}</view>
</view>
<view class="text">{{item.content}}</view>
<view class="picBox">
<view class="pic" wx:for="{{item.images}}">
<image src="{{item}}"></image>
<image src="{{item}}" mode="aspectFill"></image>
</view>
</view>
</view>
<view wx:if="{{list.length==0}}" class="noDataBox">
<view class="noDataPic">
<image src="/images/message@2x.png"></image>
<image src="/images/message@2x.png" mode="aspectFill"></image>
</view>
<view class="noDataText">这件商品还没有评价,快去评价吧~</view>
</view>
... ...
... ... @@ -6,19 +6,18 @@ Page({
pageNum: 1,
index: 4,
active: 2,
status: '',
orederId: '',
goodsid: '',
tabList: [],
totalList: [],
payList: [],
sendList: [],
evaluateList: [],
reapList: [],
totalList: [], //全部订单
payList: [], //待付款
sendList: [], //待发货
evaluateList: [], //待评价
reapList: [], //待收货
orderid: '',
bottomHint: false //触底提示
},
// 导航切换事件
// 导航切换
onClick: function (e) {
let index = e.detail.index;
switch (index) {
... ... @@ -160,9 +159,6 @@ Page({
tabList: list
})
} else {
// setTimeout(() => {
// util.getUser()
// }, 2000)
}
})
},
... ... @@ -303,7 +299,6 @@ Page({
let that = this;
//判断第一次加载订单状态
that.fristLoad(options.index)
console.log(options.index)
if (options.index == null) {
this.setData({
active: 0
... ... @@ -311,7 +306,7 @@ Page({
this.allOrder();
} else {
this.setData({
index:options.index
index: options.index
})
this.fristLoad(options.index)
}
... ... @@ -328,13 +323,6 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
// let active=this.data.active;
// if(active==){
// }
// this.setData({
// index:4
// })
},
/**
... ... @@ -355,7 +343,6 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作
*/
onRefresh() {
// wx.showNavigationBarLoading();
let index = this.data.index;
if (index == 4) {
this.setData({
... ...
... ... @@ -26,7 +26,7 @@
<!-- 商品详情 -->
<view class="bottom">
<view class="productPic">
<image src="{{item.listGoodsVoList[0].goodsPic}}"></image>
<image src="{{item.listGoodsVoList[0].goodsPic}}" mode="aspectFill"></image>
</view>
<view class="productDetail">
<view class="name">{{item.listGoodsVoList[0].goodsName}}</view>
... ... @@ -81,7 +81,7 @@
</view>
<view class="noData" wx:if="{{tabList.length==0}}">
<view class="noDataPic">
<image src="/images/message@2x.png"></image>
<image src="/images/message@2x.png" mode="aspectFill"></image>
</view>
<view class="top1">您还没有相关的订单</view>
<view class="bottom1">可以去看看有那些想买的</view>
... ...
... ... @@ -6,20 +6,15 @@ Page({
data: {
id: '', //订单号
orderId: '',
list: [],
imgs: [],
postList: [{
number: '1121545456056456445',
url: '/images/2.jpg',
name: '鲜切桃子',
detail: '监测项目:日常用品',
price: '800.00'
}],
columns: [],
wordNumber: '0',
word: '',
// list: [],
imgs: [], //上传图片
postList: [], //商品列表
columns: [], //退款原因列表
text: '', //退款原因
wordNumber: '0', //留言字数
word: '', //留言内容
show: false,
text: ''
},
//订单详情
orderDetail() {
... ... @@ -29,14 +24,10 @@ Page({
id: data.data.id,
postList: data.data
})
}else{
// setTimeout(() => {
// util.getUser()
// }, 2000)
}
} else {}
})
},
//弹出层
//退款原因
showPopup() {
this.setData({
show: true
... ... @@ -52,22 +43,14 @@ Page({
text: e.detail.value.text
})
},
//退款原因
reason() {
method.getRequest("/order/refundList",data=>{
if(data.statusCode==0){
this.setData({
columns:data.data
})
}else{
// setTimeout(() => {
// util.getUser()
// }, 2000)
}
method.getRequest("/order/refundList", data => {
if (data.statusCode == 0) {
this.setData({
columns: data.data
})
} else {}
})
// this.setData({
// text: this.data.columns[0]
// })
},
//备注
textInput: function (e) {
... ... @@ -78,51 +61,11 @@ Page({
})
},
//上传凭证
// chooseImageTap: function () {
// var that = this;
// if (that.data.imgs.length == 3) {
// wx.showToast({
// title: '最多可以上传三张图片~',
// icon: 'icon'
// })
// }
// wx.showActionSheet({
// itemList: ['从相册中选择', '拍照'],
// itemColor: "#00000",
// success: function (res) {
// if (!res.cancel) {
// if (res.tapIndex == 0) {
// that.chooseWxImage('album')
// } else if (res.tapIndex == 1) {
// that.chooseWxImage('camera')
// }
// }
// }
// })
// },
// chooseWxImage: function (type) {
// var that = this;
// var imgsPaths = that.data.imgs;
// var list = that.data.lists;
// wx.chooseImage({
// sizeType: ['original', 'compressed'],
// sourceType: [type],
// success: function (res) {
// console.log(res.tempFilePaths[0]);
// that.setData({
// imgs: res.tempFilePaths,
// })
// console.log(that.data.imgs.length, 'length')
// //that.upImgs(res.tempFilePaths[0], 0) //调用上传方法
// }
// })
// },
//删除图片
chooseImage(e) {
let that = this;
var type = e.currentTarget.dataset.type;
// let num = type == 1 ? (4 - that.data.ppath.length) : (4 - that.data.cpath.length);
if(that.data.imgs.length<3){
if (that.data.imgs.length < 3) {
wx.chooseImage({
// count: num,
sizeType: ['compressed'],
... ... @@ -133,47 +76,21 @@ Page({
mask: true
})
var uploaderList = res.tempFilePaths;
// ary.push(uploaderList[0])
// if (ary.length <= 3) {
// // that.setData({
// // imgs: ary
// // })
// } else {
// wx.showToast({
// title: '最多只能上传3张图片',
// icon: 'none'
// })
// }
console.log(uploaderList, 'liost')
if (type == 1) {
that.setData({
imags: that.data.puploaderList.concat(res.tempFilePaths),
})
// that.setData({
// puploaderNum: that.data.puploaderList.length
// })
// } else {
// that.setData({
// cuploaderList: that.data.cuploaderList.concat(res.tempFilePaths),
// })
// that.setData({
// cuploaderNum: that.data.cuploaderList.length
// })
}
that.uploadDIY(uploaderList, 0, 0, 0, uploaderList.length, type);
}
})
}else{
} else {
wx.showToast({
title: '最多只能上传三张图片',
icon:'none'
icon: 'none'
})
}
},
uploadDIY(filePaths, successUp, failUp, i, length, type) {
let that = this;
wx.uploadFile({
... ... @@ -195,7 +112,6 @@ Page({
imgs: ary
})
}
if (type == 1) {
that.data.ppath[i] = url;
that.setData({
... ... @@ -207,12 +123,6 @@ Page({
cpath: that.data.cpath
})
}
// 把获取到的路径存入imagesurl字符串中
// this.data.imagesurl
// this.setData({
// imagesurl: this.data.imagesurl.concat(data.data)
// })
// console.log(this.data.imagesurl)
},
fail: (res) => {
failUp++;
... ... @@ -229,8 +139,6 @@ Page({
}
},
})
},
delPic(e) {
console.log(e, 'e')
... ... @@ -259,14 +167,9 @@ Page({
wx.redirectTo({
url: '/pages/all-order/all-order',
})
}else{
// setTimeout(() => {
// util.getUser()
// }, 2000)
}
} else {}
})
},
//
onLoad: function (options) {
this.setData({
orderId: options.orderid
... ... @@ -274,7 +177,6 @@ Page({
let that = this;
that.orderDetail()
that.reason()
},
/**
... ...
... ... @@ -8,7 +8,7 @@
</view>
<view class="productBox">
<view class="pic">
<image src="{{postList.listGoodsVoList[0].goodsPic}}"></image>
<image src="{{postList.listGoodsVoList[0].goodsPic}}" mode="aspectFill"></image>
</view>
<view class="text">
<view class="name">{{postList.listGoodsVoList[0].goodsName}}</view>
... ... @@ -25,7 +25,7 @@
<view class="boxItem">
<view class="left">
<view>
<image src="/images/05-06/jianshu.png"></image>
<image src="/images/05-06/jianshu.png" mode="aspectFill"></image>
</view>
<view>退货件数</view>
</view>
... ... @@ -34,7 +34,7 @@
<view class="boxItem">
<view class="left">
<view>
<image src="/images/05-06/price.png"></image>
<image src="/images/05-06/price.png" mode="aspectFill"></image>
</view>
<view>退款金额</view>
</view>
... ... @@ -44,14 +44,14 @@
<view class="popupBox">
<view class="popupLeft">
<view style="padding-top:8rpx">
<image src="/images/05-06/price.png"></image>
<image src="/images/05-06/price.png" mode="aspectFill"></image>
</view>
<view> 退款原因</view>
</view>
<view class="reason">
<view>{{text}}</view>
<view style="margin-left:16rpx">
<image src="/images/04-01/arrow.png"></image>
<image src="/images/04-01/arrow.png" mode="aspectFill"></image>
</view>
</view>
</view>
... ... @@ -78,22 +78,15 @@
</view>
<view class="photo">
<view class="photoOne" bindtap="chooseImage">
<image src="/images/05-06/photo.png"></image>
<image src="/images/05-06/photo.png" mode="aspectFill"></image>
</view>
<view class="photoOne" wx:for="{{imgs}}" data-index="{{index}}">
<image src="{{item}}"></image>
<image src="{{item}}" mode="aspectFill"></image>
<view class="delBox" bindtap="delPic">
<image src="/images/05-06/chaIcon.png"></image>
<image src="/images/05-06/chaIcon.png" mode="aspectFill"></image>
</view>
</view>
<!-- <view class="photoOne">
<image src="/images/1.jpg"></image>
</view>
<view class="photoOne">
<image src="/images/1.jpg"></image>
</view> -->
</view>>
</view>
<!-- <van-uploader file-list="{{ fileList }}" /> -->
</view>
<!-- buttom -->
<view class="applyBox">
... ...
... ... @@ -3,27 +3,13 @@ let method = require("../../utils/reuqest.js");
const util = require("../../utils/util.js");
Page({
data: {
postData: {
number: '20000'
},
tabList: [{
title: '积分明细'
}, {
title: '兑换记录'
}],
list: [],
integralList: [{
title: '积分明细',
time: '2020/12/25 12:09',
num: '+176'
}],
exchangeList: [{
title: '兑换记录',
time: '2020/12/25 12:09',
num: '-176'
}],
postData: {}, //积分详情
tabList: [],
list: [], //积分明细/兑换记录列表
integralList: [], //积分明细
exchangeList: [], //兑换记录
t: '1',
bottomHint: false
bottomHint: false //触底提示
},
//第一次数据加载
getList() {
... ... @@ -115,19 +101,19 @@ Page({
* 页面相关事件处理函数--监听用户下拉动作
*/
onRefresh() {
if(this.data.t==1){
if (this.data.t == 1) {
this.setData({
page: 1,
integralList: []
})
this.cardDetail();
}else{
} else {
this.setData({
page: 1,
exchangeList: []
})
this.cardDetail();
}
}
},
onPullDownRefresh: function () {
this.onRefresh()
... ...
... ... @@ -3,32 +3,23 @@ let method = require("../../utils/reuqest.js");
const util = require("../../utils/util.js");
Page({
data: {
userData: "",
userData: "", //地址
addressId: '',
startTime: '',
cartList: [], //商品列表
goodsData: '',
goodsList: '',
showTime: false, //配送时间弹框
// storePickupTime: '',
deliveryTime: '', //配送时间年月
timers: '', // 配送时间
timerId: '',
timers: '', //配送时间
show: false,
currentDate: '12:00',
currentDateTwo: '13:00',
minHour: 1,
maxHour: 23,
length: 0,
maxlength: 50,
leavaWord: '',
discountText: '',
id: '',
date: '',
skuId: '',
orderId: '',
count: '',
stockNum: '',
stockNum: '', //库存
totalPrice: '',
cartIds: '', //购物车id
cartsId: [], //列表商品id
... ... @@ -76,14 +67,13 @@ Page({
url: '/pages/select-address/select-address',
})
},
//选择时间
//配送时间
selectTime(e) {
if (e.detail.time && e.detail.time !== this.data.timers) {
this.setData({
timers: e.detail.time,
// showTime: e.detail.flag,
deliveryTime:e.detail.deliveryTime,
deliveryTime: e.detail.deliveryTime,
showTime: false,
timerId: e.detail.timerId
})
... ... @@ -101,23 +91,12 @@ Page({
this.setData({
showTime: true
})
// this.timepicker.getDliveryTime();
},
onClickButton() {
this.setData({
showModal: true
})
},
getDayTime() {
var myDate = new Date();
var year = myDate.getFullYear();
var month = myDate.getMonth();
var day = myDate.getDate();
var dayNow = year + '-' + (month + 1) + "-" + day;
this.setData({
startTime: dayNow
})
},
//点击减少
dec() {
let that = this
... ... @@ -189,26 +168,26 @@ Page({
});
},
//立即购买
buy() {
buy: util.throttle(function () {
//生成订单
this.getAddress();
if(this.data.userData == undefined){
if (this.data.userData == undefined) {
wx.showToast({
title: '请选择收货地址',
icon: "none"
})
}else if(this.data.timers == ""){
} else if (this.data.timers == "") {
wx.showToast({
title: '请选择配送时间',
icon: "none"
})
}else{
} else {
setTimeout(() => {
let postData = {
addressId: this.data.addressId,
carts: this.data.cartsId,
couponId: this.data.couponId,
deliveryTime: this.data.deliveryTime+this.data.timers,
deliveryTime: this.data.deliveryTime + this.data.timers,
note: this.data.leavaWord,
}
method.postRequest("/order/buyNow", postData, data => {
... ... @@ -229,10 +208,10 @@ Page({
}
})
}, 500)
}
},
}, 3000),
//购物车-立即购买
buys() {
method.getRequest("/order/buyNow/" + this.data.cartIds, data => {
... ... @@ -305,28 +284,22 @@ Page({
onShow: function () {
let that = this;
//优惠券
let cartsId = wx.getStorageSync('pitchList');
let goodsCarts = wx.getStorageSync('pitchCart');
// let date = wx.getStorageSync('date');
let type = wx.getStorageSync('type') //优惠券类型
let amount = wx.getStorageSync('amount') //优惠券类型
let cardId = wx.getStorageSync('cardId')
let amount = wx.getStorageSync('amount') //优惠券满金额
let cardId = wx.getStorageSync('cardId') //优惠券id
that.setData({
cartsId: cartsId,
cartList: goodsCarts,
couponId: cardId,
// date: date,
type: type,
amount: amount
})
that.getTotalPrice();
that.getAddress();
that.getDayTime(); //获取当天时间
// that.buy();
that.getList(); //
// wx.removeStorageSync('pitchCart')
// wx.removeStorageSync('pitchList')
that.getList();
wx.removeStorageSync('cardId')
wx.setStorageSync('amount', "")
},
... ...
... ... @@ -12,7 +12,7 @@
请选择收货地址
</view>
<view class="arrow">
<image src="/images/04-01/arrow.png"></image>
<image src="/images/04-01/arrow.png" mode="aspectFill"></image>
</view>
</view>
<!-- 配送时间 -->
... ... @@ -25,7 +25,7 @@
{{timers.length ? timers : ''}}
</view>
<view class="arrow">
<image src="/images/04-01/arrow.png"></image>
<image src="/images/04-01/arrow.png" mode="aspectFill"></image>
</view>
<view class="section">
<van-popup show="{{ showTime }}" bind:close="onClose" position="bottom">
... ... @@ -38,21 +38,17 @@
<view class="cartListItem" wx:for="{{cartList}}">
<view class="itemRight">
<view class="productPic">
<image src="{{item.goodsImg}}"></image>
<image src="{{item.goodsImg}}" mode="aspectFill"></image>
</view>
<view style="width:381rpx">
<view class="productName">{{item.goodsName}}</view>
<view class="productDetail">{{item.goodsAttributes}}</view>
<view class="productPrice">
<view class="price">¥{{item.goodsPrice}}</view>
<view class="price">
<text class="moneyIcon">¥</text>
<text class="moneyNum">{{item.goodsPrice}}</text></view>
<view class="num">
<!-- <view class="reduce" catchtap="dec">
<image src="/images/04-01/reduce.png"></image>
</view> -->
<view class="numContent">x{{item.num}}</view>
<!-- <view class="add" catchtap="add">
<image src="/images/04-01/add.png"></image>
</view> -->
</view>
</view>
</view>
... ... @@ -75,7 +71,7 @@
<view class="discountText" wx:if="{{type===0}}">无门槛{{discountText}}元优惠券</view>
<!-- <view class="discountText">{{discountText}}</view> -->
<view class="arrowRight">
<image src="/images/04-01/arrow.png"></image>
<image src="/images/04-01/arrow.png" mode="aspectFill"></image>
</view>
</view>
</view>
... ...
... ... @@ -119,6 +119,16 @@
}
/* 商品列表 */
.moneyIcon{
font-size: 36rpx;
color: #FF1717;
margin-right: -10rpx;
}
.moneyNum{
font-size: 36rpx;
font-weight: 500;
color: #FF1717;
}
.cartList {
width: 686rpx;
margin: 0 auto;
... ... @@ -180,7 +190,7 @@
width: 320rpx;
height: 40rpx;
font-size: 28rpx;
font-weight: 500;
font-weight: 600;
text-align: left;
color: #333333;
line-height: 40rpx;
... ...
... ... @@ -4,59 +4,25 @@ const util = require("../../utils/util.js");
Page({
data: {
Authorization: '', //判断用户是否登录
integral: '', //用户积分
page: 1,
classifyId: "",
classifyId: "", //侧边分类id
activeKey: 0,
lableArray: [], //侧边导航
list: [], //商品列表
idx: 0, //商品规格索引
check: false, //商品规格选择
goodsData: '', //获取商品库存
keyword: '',
goodsData: '', //商品信息
stockNum: '', //获取商品库存
keyword: '', //搜索
id: '',
activeKey: 0,
count: 1,
stockNum: '',
integral: '', //积分
lableArray: [],
lableOne: [],
lableTwo: [],
lableThree: [],
list: [],
location: '',
count: 1, //加购数量
location: '', //地址解析
latitude: '', //维度
longitude: '', //经度
bottomHint: false //触底提示
},
// tabbar
toHome() {
wx.reLaunch({
url: '/pages/home/home',
})
},
toShopCart() {
wx.reLaunch({
url: '/pages/shopping-cart/shopping-cart',
})
},
toUser() {
wx.reLaunch({
url: '/pages/user/user',
})
},
//获取定位
// getLocation() {
// let that = this;
// wx.getLocation({
// type: 'gcj02',
// success(res) {
// that.setData({
// latitude: res.latitude,
// longitude: res.longitude
// })
// that.location();
// const speed = res.speed
// const accuracy = res.accuracy
// }
// })
// },
//获取位置信息
location() {
let that = this
console.log(that.data.latitude, '5555')
... ... @@ -71,9 +37,6 @@ Page({
})
},
//搜索框
doSearch() {
},
getKeyWord(e) {
this.setData({
keyword: e.detail.value
... ... @@ -158,6 +121,7 @@ Page({
}
})
},
//加入购物车
addCart(e) {
if (this.data.Authorization) {
let id = e.currentTarget.dataset.id
... ... @@ -321,7 +285,6 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
// this.dataRequest();
this.catalog();
if (wx.getStorageSync('categoryId')) {
let id = wx.getStorageSync('categoryId')
... ...
... ... @@ -3,7 +3,7 @@
<view class="searchMain">
<view class="location">
<view style="display:inline-block;height: 20rpx;width: 20rpx;" bindtap="open">
<image src="/images/location.png"></image>
<image src="/images/location.png" mode="aspectFill"></image>
</view>
<text>{{location}}</text>
</view>
... ... @@ -13,35 +13,13 @@
<input class="weui-input" auto-focus="{{false}}" placeholder="请输入商品名称" bindinput="getKeyWord"
placeholder-class="placeholder" />
<view class="search_right" catchtap="search">
<image src="/images/01-02/sousuo.png"></image>
<image src="/images/01-02/sousuo.png" mode="aspectFill"></image>
</view>
</view>
</view>
</view>
</view>
<!-- 头部导航 -->
<!-- <view class="box">
<scroll-view scroll-x="true" class="scroll">
<view wx:for="{{}}" class="item">
{{item}}
</view>
</scroll-view>
<view class="arrow" bindtap="pullDown">
<image src="/images/04-01/arrow.png">
</image>
</view>
<view wx:if="{{show}}" class="pullDownBox">
<view class="mainClassify">
全部分类
</view>
<view wx:for="{{}}" class="downItem" catchtap="">
{{item}}
</view>
</view>
</view>
<view class="mask" wx:if="{{show}}" catchtap="pullDown">
</view> -->
<!-- 侧边导航 -->
<view class="navSide">
<van-sidebar active-key="{{ activeKey }}" style="background:rgb(247,248,250)">
... ... @@ -54,7 +32,7 @@
<scroll-view scroll-with-animation scroll-y class="scroll-view">
<view class="navItem" wx:for="{{list}}" data-id="{{item.goodsId}}" data-index="{{index}}" bindtap="goGoodsDetail">
<view class="productLeft">
<image src="{{item.goodsImg}}"></image>
<image src="{{item.goodsImg}}" mode="aspectFill"></image>
</view>
<view class="productRight">
<view class="name">{{item.goodsName}}</view>
... ... @@ -66,11 +44,11 @@
{{item.goodsPrice}}</view>
<view class="addIcon" catchtap="addCart" data-id="{{item.goodsId}}" data-index="{{index}}"
wx:if="{{item.type==2}}">
<image src="/images/03-02/tianjia.png"></image>
<image src="/images/03-02/tianjia.png" mode="aspectFill"></image>
</view>
<view class="exchange" wx:if="{{item.type==1}}" catchtap="exchange" data-integral="{{item.goodsPrice}}"
data-defaultSku="{{item.defaultSku}}">
<image src="/images/03-02/duihuan.png"></image>
<image src="/images/03-02/duihuan.png" mode="aspectFill"></image>
</view>
</view>
</view>
... ... @@ -85,7 +63,7 @@
<view class="mask" catchtap="closeMask" wx:if='{{showMask}}'>
<view class="diceng" catchtap="openMask">
<view class="info">
<image src="{{goodsData.goodsBanners[0]}}"></image>
<image src="{{goodsData.goodsBanners[0]}}" mode="aspectFill"></image>
<view class="info_right">
<view class="info_name">{{goodsData.goodsName}}</view>
<view class="info_price">¥{{goodsData.list[idx].goodsPrice}}</view>
... ... @@ -115,33 +93,4 @@
</view>
<view class="confrimBtn" catchtap="confrimCart">确定</view>
</view>
</view>
<!-- tabbar -->
<!-- <view class="tabbarBox">
<ul>
<li>
<view class="tabbarPic" bindtap="toHome">
<image src="/images/tab/home.png"></image>
</view>
<text bindtap="toHome">首页</text>
</li>
<li>
<view class="tabbarPic">
<image src="/images/tab/classify.png"></image>
</view>
<text class="check">分类</text>
</li>
<li>
<view class="tabbarPic" bindtap="toShopCart">
<image src="/images/tab/cart (2).png"></image>
</view>
<text bindtap="toShopCart">购物车</text>
</li>
<li>
<view class="tabbarPic" bindtap="toUser">
<image src="/images/tab/user.png"></image>
</view>
<text bindtap="toUser">我的</text>
</li>
</ul>
</view> -->
\ No newline at end of file
</view>
\ No newline at end of file
... ...
... ... @@ -13,13 +13,13 @@
<view class="time">{{startTime}}-{{endTime}}</view>
<view class="time">{{item.time}}</view>
</view>
<view class="bjPic">
<image src="/images/youhuiquan.png" mode="aspectFill"></image>
</view>
<view class="topCircle"></view>
<view class="bottomCircle"></view>
</view>
<!-- <view class="bgPic">
<image src="/images/youhuiquan.png"></image>
</view> -->
</view>
<view class="bottomHint" wx:if="{{bottomHint}}">
我是有底线的~
... ...
... ... @@ -17,12 +17,11 @@
height: 246rpx;
}
.picBox {
width:95%;
width:92%;
height: 246rpx;
margin: 0 auto;
margin-bottom: 24rpx;
display: flex;
background-color: #ffffff;
position: relative;
border-radius: 16rpx;
}
... ... @@ -30,12 +29,11 @@
.picBox .left {
width: 200rpx;
height: 244rpx;
background: linear-gradient(270deg, #f09c4d -70%, #ff4903);
/* background: linear-gradient(270deg, #fb7900 -100%, #ff4903); */
padding-top: 48rpx;
padding-bottom: 48rpx;
box-sizing: border-box;
border-radius: 16rpx;
z-index: 9;
}
.left>view {
... ... @@ -56,6 +54,7 @@
padding-bottom: 78rpx;
padding-left: 32rpx;
box-sizing: border-box;
z-index: 9;
}
.right>view {
... ... @@ -72,7 +71,18 @@ color: #999999;
letter-spacing: 0px;
margin-top: 24rpx;
}
.topCircle{
.bjPic{
width: 100%;
height: 246rpx;
position: absolute;
top: 0;
left: 0;
}
.bjPic image{
width: 100%;
height: 100%;
}
/* .topCircle{
position: absolute;
top: -4px;
left: 28%;
... ... @@ -80,8 +90,8 @@ margin-top: 24rpx;
height: 20rpx;
background-color: #f1f2f4;
border-radius: 50%;
}
.bottomCircle{
} */
/* .bottomCircle{
position: absolute;
bottom: -4px;
left: 28%;
... ... @@ -89,7 +99,7 @@ margin-top: 24rpx;
height: 20rpx;
background-color: #f1f2f4;
border-radius: 50%;
}
} */
.listBlank{
width: 750rpx;
height:400rpx;
... ...
... ... @@ -4,18 +4,17 @@ const util = require("../../utils/util.js");
const chooseLocation = requirePlugin('chooseLocation');
Page({
data: {
id: '', //地址id
id: '', //地址id
username: '',
phone: '',
value: '',
switchChecked:false,
switchChecked:false, //默认地址
show: false,
selectBox: true,
location: '',
flag: true,
latitude: "",
longitude: "",
latitudes: "", //传值给后台
latitudes: "", //传值给后台
longitudes: ""
},
//姓名
... ... @@ -86,8 +85,8 @@ Page({
},
map() {
let that = this;
const key = 'C4QBZ-UYQLI-S45G2-5ETMC-LQYWE-L6FJU'; //使用在腾讯位置服务申请的key
const referer = '春晓世纪华联超市'; //调用插件的app的名称
const key = 'C4QBZ-UYQLI-S45G2-5ETMC-LQYWE-L6FJU';
const referer = '春晓世纪华联超市';
const category = '房产小区,其它';
wx.getLocation({
type: 'gcj02',
... ... @@ -123,21 +122,6 @@ Page({
console.log(e.detail.values, '确认')
},
//开关
// onChange(detail) {
// if(this.data.checked==1){
// this.setData({
// checked:!detail
// })
// }else{
// this.setData({
// checked:detail
// // checked: !this.data.checked
// })
// }
// console.log(detail,'detail')
// },
switch1Change(e){
console.log(e.detail.value,'value')
this.setData({
... ... @@ -163,8 +147,6 @@ Page({
})
} else {
let delFlags = this.data.switchChecked == true ? 1 : 0;
// let region = this.data.region;
// let addressStr = region[0] + "" + region[1] + "" + region[2]
let postData = {
address: this.data.value,
area: this.data.location,
... ... @@ -241,8 +223,6 @@ Page({
longitudes: options.locations.split(",")[1],
id: options.id
})
console.log(this.data.switchChecked)
// }
},
... ...
... ... @@ -4,23 +4,6 @@
<van-field value="{{ username }}" clearable label="姓名" icon="question-o" placeholder="请输入姓名"
bind:click-icon="onClickIcon" bindinput="inputName" />
<van-field value="{{ phone }}" label="电话" placeholder="请输入电话" bindinput="inputDel" bindblur="blurPhone" />
<!-- 地址 -->
<!-- <van-cell title="展示弹出层" is-link bindtap="showPopup"> -->
<!-- <view class="popups">
<view catchtap="map">地区</view>
<view class="addBox" catchtap="map">
<picker mode="region" bindchange="bindRegionChange" value="{{region}}" custom-item="{{customItem}}">
<view class="picker">
{{region[0]}},{{region[1]}},{{region[2]}}
</view>
</picker>
</view>
</view> -->
<!-- </van-cell> -->
<!-- <van-popup show="{{ show }}" bind:close="onClose" position="bottom" custom-style="height: 30%">
<van-area area-list="{{ areaList }}" value="area" columns-placeholder="{{ ['请选择', '请选择', '请选择'] }}"
bind:change="changeAddress" bind:confirm="chooseAddress" bind:cancel="cancelChoose">{{city}}</van-area>
</van-popup> -->
<view class="location" catchtap="map">
<text style="width:200rpx">收货地址</text>
<text class="locationItem">{{location}}</text>
... ... @@ -32,8 +15,6 @@
<view class="defaultAddress">
<view class="defaultText">设为默认地址</view>
<view class="switch">
<!-- <van-switch checked="{{checked}}" bind:change="onChange" inactive-color="#d3d3d3" size="48rpx"
style="margin-left:-60rpx" /> -->
<view class="body-view">
<switch checked="{{switchChecked}}" bindchange="switch1Change" />
</view>
... ...
... ... @@ -20,17 +20,6 @@
value="{{content}}"></textarea>
<view class="number">300/{{length}}</view>
<!-- <view class="photo">
<view class="photoOne" bindtap="chooseImageTap">
<image src="/images/05-06/photo.png"></image>
</view>
<view class="photoOne" wx:for="{{imgs}}" data-index="{{index}}">
<image src="{{item}}"></image>
<view class="delBox" bindtap="delPic">
<image src="/images/05-06/chaIcon.png"></image>
</view>
</view>
</view> -->
<!-- 上传凭证 -->
<view class="photoBox">
<view class="photoText">
... ... @@ -39,7 +28,7 @@
</view>
<view class="photo">
<view class="photoOne" bindtap="chooseImage">
<image src="/images/05-06/photo.png"></image>
<image src="/images/05-06/photo.png" mode="aspectFill"></image>
</view>
<view class="photoOne" wx:for="{{imgs}}" data-index="{{index}}">
<image src="{{item}}"></image>
... ...
<!--pages/home/home.wxml-->
<image src="/images/homeBj.png" class="topImage"></image>
<image src="/images/homeBj.png" class="topImage" mode="aspectFill"></image>
<view class="pageTitle1 "></view>
<view class="pageTitle">世纪华联</view>
<view class="contenter">
... ... @@ -15,11 +15,11 @@
placeholder="搜索" bind:focus="goSearch" />
</view>
<!-- 轮播图 -->
<view style="margin-top:60rpx">
<view style="margin-top:80rpx">
<swiper class="swiper" indicator-dots="true" autoplay="true" interval="5000" duration="1000">
<block wx:for="{{swiperArray}}" wx:for-index="idx">
<swiper-item bindtap="goBannnerDetail" data-url="{{item.url}}" data-index="{{index}}">
<image src="{{item.img}}" class="slideImage"></image>
<image src="{{item.img}}" class="slideImage" mode="aspectFill"></image>
</swiper-item>
</block>
</swiper>
... ... @@ -30,7 +30,7 @@
<view wx:for="{{classifyArray}}" class="classifyItem" bindtap="classifyEvent" data-id="{{item.categoryId}}"
data-index="{{index}}">
<view class="classifyPic">
<image src="{{item.icon}}"></image>
<image src="{{item.icon}}" mode="aspectFill"></image>
</view>
<view class="classifyText">{{item.categoryName}}</view>
</view>
... ... @@ -55,7 +55,7 @@
<scroll-view class='wrapper' scroll-x="true">
<view class="contentItem" wx:for="{{discountArray}}">
<view class="countPic" bindtap="goGoodsDetail" data-id="{{item.goodsId}}">
<image src="{{item.goodsImg}}"></image>
<image src="{{item.goodsImg}}" mode="aspectFill"></image>
</view>
<view class="countText">{{item.goodsName}}</view>
<view class="countPrice">
... ... @@ -65,7 +65,7 @@
<view class="countNum">
<view class="num">还剩{{item.goodsStock}}件</view>
<view class="icon" bindtap="addCart" data-id="{{item.defaultSku}}" data-type="{{item.type}}">
<image src="/images/01-01/cart.png"></image>
<image src="/images/01-01/cart.png" mode="aspectFill"></image>
</view>
</view>
</view>
... ... @@ -93,7 +93,7 @@
<view class="dayPricePicMain">
<scroll-view class='wrapper' scroll-x="true">
<view wx:for="{{dayPicArray}}" class="dayPricePic" bindtap="goGoodsDetail" data-id="{{item.goodsId}}">
<image src="{{item.goodsImg}}"></image>
<image src="{{item.goodsImg}}" mode="aspectFill"></image>
</view>
</scroll-view>
</view>
... ... @@ -112,7 +112,7 @@
<view class="dayPricePicMain">
<scroll-view class='wrapper' scroll-x="true">
<view wx:for="{{marilyArray}}" class="dayPricePic" bindtap="goGoodsDetail" data-id="{{item.goodsId}}">
<image src="{{item.goodsImg}}"></image>
<image src="{{item.goodsImg}}" mode="aspectFill"></image>
</view>
</scroll-view>
</view>
... ... @@ -125,7 +125,7 @@
<view class="pickContent">
<view class="pickItem" wx:for="{{pickList}}" data-id="{{item.goodsId}}" bindtap="goGoodsDetail">
<view class="pickPic">
<image src="{{item.goodsImg}}"></image>
<image src="{{item.goodsImg}}" mode="aspectFill"></image>
</view>
<view class="pickTitle">{{item.goodsName}}</view>
<view class="pickDesc">{{item.goodsAttributes}}</view>
... ... @@ -148,10 +148,10 @@
<van-popup show="{{show}}" bind:close="onClose">
<view class="popupBox">
<view class="delIcon" bindtap="onClose">
<image src="/images/icon_close@2x.png"></image>
<image src="/images/icon_close@2x.png" mode="aspectFill"></image>
</view>
<view class="popupPic">
<image src="/images/popup.png"></image>
<image src="/images/popup.png" mode="aspectFill"></image>
</view>
<view>
<view class="popupText"> 实名优惠活动券</view>
... ...
... ... @@ -129,7 +129,7 @@ page {
}
/* 分类 */
.classify {
.classify1 {
width: 100%;
/* margin-top: 18rpx; */
/* background-color: bisque; */
... ... @@ -146,18 +146,18 @@ page {
display: inline-block;
}
.classify .classifyPic {
.classify1 .classifyPic {
width: 104rpx;
height: 89rpx;
}
.classify .classifyPic image {
.classify1 .classifyPic image {
width: 104rpx;
height: 89rpx;
border-radius: 16rpx;
}
.classify .classifyText {
.classify1 .classifyText {
width: 104rpx;
height: 34rpx;
font-size: 24rpx;
... ... @@ -424,6 +424,7 @@ page {
.dayPricePic image {
width: 100%;
height: 100%;
border-radius: 16rpx;
}
.mainly .mainlyTitle {
... ...
... ... @@ -179,7 +179,7 @@ Page({
}
},
//商品-生成订单
creatOrder() {
creatOrder: util.throttle(function () {
if (this.data.userData == undefined) {
wx.showToast({
title: '请选择收货地址',
... ... @@ -214,8 +214,7 @@ Page({
}
})
}
},
}, 3000),
//立即兑换
exchange() {
let postData = {
... ...
... ... @@ -43,13 +43,14 @@
<view class="cartListItem">
<view class="itemRight">
<view class="productPic">
<image src="{{goodsData.goodsImg}}"></image>
<image src="{{goodsData.goodsImg}}" mode="aspectFill"></image>
</view>
<view style="width:381rpx">
<view class="productName">{{goodsData.goodsName}}</view>
<view class="productDetail">{{goodsData.goodsDesc}}</view>
<view class="productPrice">
<view class="price">¥{{goodsData.goodsPrice}}</view>
<view class="price"> <text class="moneyIcon">¥</text>
<text class="moneyNum">{{goodsData.goodsPrice}}</text></view>
<view class="num">
<view>X{{count}}</view>
</view>
... ...
... ... @@ -19,6 +19,7 @@ page {
color: #323233;
width: 204rpx;
}
.calendar1 {
font-size: 28rpx;
font-weight: 400;
... ... @@ -161,6 +162,18 @@ page {
}
/* 商品列表 */
.moneyIcon {
font-size: 36rpx;
color: #FF1717;
margin-right: -8rpx;
}
.moneyNum {
font-size: 36rpx;
font-weight: 500;
color: #FF1717;
}
.cartList {
width: 686rpx;
margin: 0 auto;
... ... @@ -224,7 +237,7 @@ page {
width: 320rpx;
height: 40rpx;
font-size: 28rpx;
font-weight: 500;
font-weight: 600;
text-align: left;
color: #333333;
line-height: 40rpx;
... ...
... ... @@ -3,7 +3,7 @@
<!-- 商品信息 -->
<view class="productInfo">
<view class="leftPic">
<image src="{{postData.listGoodsVoList[0].goodsPic}}"></image>
<image src="{{postData.listGoodsVoList[0].goodsPic}}" mode="aspectFill"></image>
</view>
<view class="rightText">
<view class="name">{{postData.listGoodsVoList[0].goodsName}}</view>
... ... @@ -25,7 +25,7 @@
<view class="expressName">
<view class="expressLeft">
<view class="expressIcon">
<image src="/images/05-08/ysExpress.png"></image>
<image src="/images/05-08/ysExpress.png" mode="aspectFill"></image>
</view>
<view>运送快递</view>
</view>
... ... @@ -34,7 +34,7 @@
<view class="expressNumber">
<view class="expressLeft">
<view class="expressIcon">
<image src="/images/05-08/number.png"></image>
<image src="/images/05-08/number.png" mode="aspectFill"></image>
</view>
<view>快递单号</view>
</view>
... ...
... ... @@ -15,7 +15,7 @@
<view class="pickContent">
<view class="pickItem" wx:for="{{list}}" data-id="{{item.goodsId}}" bindtap="goGoodsDetail">
<view class="pickPic">
<image src="{{item.goodsImg}}"></image>
<image src="{{item.goodsImg}}" mode="aspectFill"></image>
</view>
<view class="pickTitle">{{item.goodsName}}</view>
<view class="pickDesc">{{item.goodsAttributes}}</view>
... ...
... ... @@ -9,7 +9,7 @@
<view class="main_item_content ">
<!-- <van-card num="{{item.num}}" price="{{item.goodsPrice}}" desc="{{item.goodsAttributes}}" title="{{item.goodsName}}" thumb="{{item.goodsImg}}" /> -->
<view class="left">
<image src="{{item.goodsImg}}"></image>
<image src="{{item.goodsImg}}" mode="aspectFill"></image>
</view>
<view class="right">
<view class="name">{{item.goodsName}}</view>
... ...
... ... @@ -19,6 +19,7 @@ Page({
time: '2020.05.18-2017.12.30'
}],
id: '',
bottomHint:false
},
//获取优惠券
... ... @@ -118,8 +119,15 @@ Page({
this.setData({
pageNums: this.data.pageNums + 1
})
console.log(this.data.pageNums, 'num')
this.getDiscounCard()
this.setData({
bottomHint:true
})
setTimeout(()=>{
this.setData({
bottomHint:false
})
},2000)
},
/**
... ...
<!--pages/my-discount-card/my-discount-card.wxml-->
<!--pages/discount-card/discount-card.wxml-->
<view class="container">
<view class="picBox" wx:for="{{cardList}}" data-index="{{index}}" data-id="{{item.id}}" bindtap="useCard" data-type="{{item.type}}" data-amount="{{item.fullAmount}}"data-cardamount="{{item.amount}}">
<view class="left">
<view class="price">¥{{item.amount}}</view>
<view wx:if="{{item.fullAmount==undefined}}">无门槛使用</view>
<view wx:if="{{item.fullAmount!==undefined}}">满{{item.fullAmount}}可用</view>
</view>
<view class="right">
<view>{{item.name}}</view>
<view class="time">{{item.startTime}}-{{item.endTime}}</view>
<view class="time">{{item.time}}</view>
</view>
<view class="topCircle"></view>
<view class="bottomCircle"></view>
</view>
<view class="listBlank" wx:if="{{cardList.length==0}}">
暂无可用优惠券~
</view>
</view>
<view class="picBox" wx:for="{{cardList}}" data-index="{{index}}" data-id="{{item.id}}" bindtap="useCard"
data-type="{{item.type}}" data-amount="{{item.fullAmount}}" data-cardamount="{{item.amount}}">
<view class="left">
<view class="price">¥{{item.amount}}</view>
<view wx:if="{{item.fullAmount==undefined}}">无门槛使用</view>
<view wx:if="{{item.fullAmount!==undefined}}">满{{item.fullAmount}}可用</view>
</view>
<view class="right">
<view>{{item.name}}</view>
<view class="time">{{item.startTime}}-{{item.endTime}}</view>
<view class="time">{{item.time}}</view>
</view>
<view class="bgPic">
<image src="/images/youhuiquan.png" ></image>
</view>
</view>
<view class="bottomHint" wx:if="{{bottomHint}}">
我也是有底线的~
</view>
<view class="listBlank" wx:if="{{cardList.length==0}}">
暂无可用优惠券~
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -13,17 +13,16 @@
margin: 0 auto;
margin-bottom: 24rpx;
display: flex;
background-color: #ffffff;
position: relative;
}
.picBox .left {
width: 200rpx;
height: 244rpx;
background: linear-gradient(270deg, #f09c4d -70%, #ff4903);
padding-top: 48rpx;
padding-bottom: 48rpx;
box-sizing: border-box;
z-index: 9;
}
.left>view {
... ... @@ -44,6 +43,7 @@
padding-bottom: 78rpx;
padding-left: 32rpx;
box-sizing: border-box;
z-index: 9;
}
.right>view {
... ... @@ -60,23 +60,14 @@ color: #999999;
letter-spacing: 0px;
margin-top: 24rpx;
}
.topCircle{
.bgPic{
position: absolute;
top: -4px;
left: 98px;
width: 20rpx;
height: 20rpx;
background-color: #f1f2f4;
border-radius: 43%;
top: 0;
left: 0;
}
.bottomCircle{
position: absolute;
bottom: -4px;
left: 96px;
width: 20rpx;
height: 20rpx;
background-color: #f1f2f4;
border-radius: 50%;
.bgPic image{
width: 686rpx;
height: 246rpx;
}
.listBlank{
width: 750rpx;
... ... @@ -86,4 +77,11 @@ margin-top: 24rpx;
align-items: center;
color: #999999;
font-size: 30rpx;
}
.bottomHint{
font-size: 24rpx;
color: #999999;
display: flex;
justify-content: center;
padding-bottom: 20rpx;
}
\ No newline at end of file
... ...
... ... @@ -12,13 +12,7 @@ Page({
txt: '积分兑换卡',
englis: 'Go to get it now'
},
getData: {
headPic: '/images/1.jpg',
userName: '孙俪',
text: '积分条形码',
codePic: '/images/card.png',
cardNumber: '12345678910111213'
},
getData: { }, //会员卡详情
noVip: true,
vip: false,
},
... ... @@ -73,7 +67,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
let vip = wx.getStorageSync('vip')
let vip = wx.getStorageSync('vip')
if (vip) {
this.setData({
noVip: false,
... ...
... ... @@ -2,8 +2,8 @@
<view class="topLine">
</view>
<!-- 领取会员卡 -->
<!-- <view class="getCard" wx:if="{{noVip}}" > -->
<view class="getCard" wx:if="{{true}}" >
<view class="getCard" wx:if="{{noVip}}" >
<!-- <view class="getCard" wx:if="{{true}}" > -->
<view class="title">
{{postData.title}}
</view>
... ... @@ -14,22 +14,8 @@
</view>
<!-- card -->
<view class="cardBox">
<image src="/images/card (2).png"></image>
</view>
<view class="cardBoxTwo">
<view class="top">
<view class="left">
<view class="icon">
<image src="{{postData.icon}}"></image>
</view>
<view class="text">
<view>{{postData.name}}</view>
<view class="card">{{postData.card}}</view>
</view>
</view>
<view class="right">{{postData.txt}}</view>
</view>
<view class="bottom">{{postData.englis}}</view>
<!-- <image src="/images/card (2).png"></image> -->
<image src="/images/vipcard.png"></image>
</view>
<!-- bottom -->
<view class="btn" bindtap="getCart">
... ... @@ -37,8 +23,8 @@
</view>
</view>
<!-- 会员卡详情 -->
<view class="cardDetail" wx:if="{{false}}">
<!-- <view class="cardDetail" wx:if="{{vip}}"> -->
<!-- <view class="cardDetail" wx:if="{{false}}"> -->
<view class="cardDetail" wx:if="{{vip}}">
<image src="/images/card.png" ></image>
<!-- content -->
<view class="cardBox1">
... ...
... ... @@ -41,89 +41,6 @@
margin: 0 auto;
margin-top: 44rpx;
}
.cardBoxTwo {
width: 612rpx;
height: 310rpx;
background-color: antiquewhite;
z-index: 99;
position: absolute;
top: 116px;
border-radius: 16rpx;
left: 70rpx;
background: transparent;
}
.top {
height: 174rpx;
display: flex;
padding-top: 36rpx;
padding-bottom: 60rpx;
padding-left: 32rpx;
box-sizing: border-box;
}
.top .left {
width: 348rpx;
display: flex;
}
.icon {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
margin-right: 18rpx;
}
.text {
font-size: 32rpx;
font-weight: 600;
text-align: left;
color: #ffffff;
text-shadow: 0px 2rpx 4rpx 0px #5e3600;
}
.card {
font-size: 24rpx;
font-weight: 400;
color: #ffffff;
text-shadow: 0px 1px 2px 0px #5e3600;
margin-top: 8rpx;
}
.icon image {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
}
.top .right {
width: 144rpx;
height: 50rpx;
border: 2rpx solid #ffffff;
border-radius: 6rpx;
font-size: 24rpx;
font-weight: 400;
text-align: left;
color: #ffffff;
text-shadow: 0px 1px 2px 0px #5e3600;
margin-left: 48rpx;
margin-top: 14rpx;
display: flex;
justify-content: center;
align-items: center;
}
.bottom {
height: 136rpx;
padding-left: 24rpx;
box-sizing: border-box;
font-size: 28rpx;
font-weight: 500;
color: #ffffff;
text-shadow: 0px 2rpx 4rpx 0px #5e3600;
padding-top: 64rpx;
box-sizing: border-box;
}
/* bottom */
.btn {
... ... @@ -207,6 +124,9 @@
.text {
margin-top: 20rpx;
text-align: center;
font-size: 36rpx;
font-weight: 600;
}
.codePic {
... ...
... ... @@ -2,17 +2,12 @@
let method = require("../../utils/reuqest.js")
Page({
data: {
flag:false, //判断是否为退款订单
refoundStatus:'',
goodsId:'',
userData: {
},
requestData: {},
cartList: [],
flag: false, //判断是否为退款订单
refoundStatus: '', //退款状态
goodsId: '',
userData: {},
requestData: {}, //订单信息
num: '2222',
discountText: '满3减1满3减1',
allMoney: '4.00',
giveFee: '8.00',
orderData: {
number: '123456789456123',
time: '2020-11-03',
... ... @@ -23,50 +18,49 @@ Page({
orderDetail(orderId) {
method.getRequest("/order/orderItem/" + orderId, data => {
if (data.statusCode == 0) {
this.setData({
requestData:data.data,
goodsId:data.data.listGoodsVoList[0].goodsId,
this.setData({
requestData: data.data,
goodsId: data.data.listGoodsVoList[0].goodsId,
// refoundStatus:this.data.requestData.returnVos[0].status
})
let status=this.data.requestData.returnVos[0].status
this.setData({
refoundStatus:status
})
console.log(this.data.requestData.returnVos[0].status)
})
let status = this.data.requestData.returnVos[0].status
this.setData({
refoundStatus: status
})
console.log(this.data.requestData.returnVos[0].status)
}
})
},
//商品详情
goGoodsDetail(e){
let goodsid=e.currentTarget.dataset.id;
goGoodsDetail(e) {
let goodsid = e.currentTarget.dataset.id;
wx.navigateTo({
url: '/pages/product-detail/product-detail?id='+goodsid,
url: '/pages/product-detail/product-detail?id=' + goodsid,
})
},
//再次购买
buyAgain(){
console.log(this.data.goodsId,'goods')
wx.redirectTo({
url: '/pages/product-detail/product-detail?id='+this.data.goodsId,
})
buyAgain() {
wx.redirectTo({
url: '/pages/product-detail/product-detail?id=' + this.data.goodsId,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
let orderId = options.orderId
if(options.flag){
this.setData({
flag:true
})
if (options.flag) {
this.setData({
flag: true
})
}
if(options.orderId){
if (options.orderId) {
this.orderDetail(orderId)
}else{
} else {
this.orderDetail(wx.getStorageSync('orderId'));
wx.removeStorageSync('orderId')
}
},
/**
... ...
... ... @@ -15,19 +15,12 @@
<view class="default">默认</view>
<view class="userAddress">{{requestData.receiverDetailAddress}}</view>
</view>
<!-- 配送时间 -->
<!-- <view class="timeBox">
<view class="text">请选择配送时间{{requestData.deliveryTime}}</view>
<view class="timeArrow">
<image src="/images/04-01/arrow.png"></image>
</view>
</view> -->
<!-- 商品列表 -->
<view class="cartList">
<view class="cartListItem" wx:for="{{requestData.listGoodsVoList}}" bindtap="goGoodsDetail" data-id="{{item.goodsId}}">
<view class="itemRight">
<view class="productPic">
<image src="{{item.goodsPic}}"></image>
<image src="{{item.goodsPic}}" mode="aspectFill"></image>
</view>
<view style="width:434rpx">
<view class="productName">{{item.goodsName}}</view>
... ... @@ -49,8 +42,6 @@
<view wx:if="{{requestData.note!==''}}">
<view class="messageBox">
<view class="messageTitle">买家留言:</view>
<!-- <textarea name="" id="" cols="30" rows="10" value="{{content}}" placeholder="留言建议提前协商50字之内" maxlength="50"
bindinput="userInput"></textarea> -->
<view>{{requestData.note}}</view>
<view class="numLength">{{requestData.note.length}}/50</view>
</view>
... ... @@ -60,9 +51,6 @@
<view>优惠券抵扣金额</view>
<view class="discountBox">
<view class="discountText">{{requestData.couponAmount}}</view>
<!-- <view class="arrowRight">
<image src="/images/04-01/arrow.png"></image>
</view> -->
</view>
</view>
<!-- 商品总额 -->
... ...
... ... @@ -7,10 +7,8 @@ Page({
id: '',
skuId: '',
goodsId: '',
swiperArray: [{
url: '/images/1.jpg'
}],
countDownShow: '',
swiperArray: [], //商品轮播图
countDownShow: '', //判断限时优惠商品
time: '', //倒计时
timeData: '',
hour: "",
... ... @@ -18,12 +16,9 @@ Page({
second: "",
endTimess: '',
goodsData: '',
productName: '三好龙虾 招牌泼油小龙虾',
price: '¥688.00',
selectNum: '30',
pingjiaNum: 0,
infoList: [], //评价
image: '', //评价图片
infoList: [],//评价
image: '', //评价图片
flags: true,
deacArray: [],
flag: 1,
... ... @@ -37,11 +32,11 @@ Page({
richText: '',
couponVos: [], //优惠券列表
userData: '', //地址信息
ceshi: [], //商品规格
idx: 0, //商品规格
ceshi: [], //商品规格
idx: 0, //商品规格索引
jifenNum: '', //商品积分
integral: '',
bottomHint:false //触底提示
integral: '', //用户积分
bottomHint: false //触底提示
},
//倒计时
onChange1(e) {
... ... @@ -148,10 +143,6 @@ Page({
},
//查看全部评价
openAll() {
// this.setData({
// flags: !this.data.flags,
// flag: !this.data.flag
// })
wx.navigateTo({
url: '/pages/all-evaluate/all-evaluate?goodsid=' + this.data.goodsId,
})
... ... @@ -169,15 +160,15 @@ Page({
}
},
getCartNum() {
method.getRequest("/cart/countCart",data=>{
if(data.statusCode==0){
if(data.data!==0){
this.setData({
cartGoodNum:data.data
})
}
method.getRequest("/cart/countCart", data => {
if (data.statusCode == 0) {
if (data.data !== 0) {
this.setData({
cartGoodNum: data.data
})
}
}
})
},
// 收藏
... ... @@ -212,11 +203,7 @@ Page({
},
//联系客服
linkKefu() {
if (getStorageSync.Authorization == "") {
// setTimeout(() => {
// util.getUser()
// }, 2000)
} else {
wx.makePhoneCall({
phoneNumber: '111111111000',
... ... @@ -319,9 +306,6 @@ Page({
duration: 1000
})
} else {
// setTimeout(() => {
// util.getUser()
// }, 2000)
}
})
},
... ... @@ -356,38 +340,6 @@ Page({
count
})
},
//立即兑换
immediatelyExchang() {
this.getAddress()
let postData = {
addressId: this.data.userData.id,
couponId: this.data.couponId,
deliveryTime: this.data.date,
note: this.data.leavaWord,
num: this.data.count,
skuId: this.data.skuId
}
method.postRequest("/order/generateOrder", postData, data => {
if (data.statusCode == 0) {
this.setData({
orderId: data.data.id
})
wx.navigateTo({
url: '/pages/affirm-order/affirm-order',
})
} else {
// setTimeout(() => {
// util.getUser()
// }, 2000)
console.log("999999")
wx.showToast({
title: '积分不足',
icon: 'none',
duration: 3000
})
}
})
},
//地址信息
getAddress() {
method.getRequest("/address", data => {
... ... @@ -485,9 +437,6 @@ Page({
duration: 1000
})
} else {
// setTimeout(() => {
// util.getUser()
// }, 2000)
}
})
},
... ... @@ -531,7 +480,7 @@ Page({
this.setData({
id: options.id
})
//在发送请求goodsId数据
//请求商品信息
if (options.id) {
this.getList(options.id)
} else if (goodsId) {
... ... @@ -554,7 +503,7 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.countDown() //获取优惠剩余时间
this.countDown() //获取优惠剩余时间
this.getCartNum() //获取购物车商品总数量
setTimeout(() => {
this.demoDown();
... ... @@ -596,14 +545,14 @@ Page({
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.setData({
bottomHint: true
})
setTimeout(() => {
this.setData({
bottomHint:true
bottomHint: false
})
setTimeout(()=>{
this.setData({
bottomHint:false
})
},2000)
}, 2000)
},
/**
... ... @@ -612,7 +561,6 @@ Page({
onShareAppMessage: function (res) {
console.log(this.data.goodsId, 'id')
if (res.from === 'button') {
// console.log(id)
}
return {
title: '世纪华联超市',
... ...
... ... @@ -7,7 +7,7 @@
<swiper class="swiper" indicator-dots="true" autoplay="true" interval="5000" duration="1000">
<block wx:for="{{swiperArray}}" wx:for-index="idx">
<swiper-item>
<image src="{{item}}" class="slideImage"></image>
<image src="{{item}}" class="slideImage" mode="aspectFill"></image>
</swiper-item>
</block>
</swiper>
... ... @@ -71,10 +71,10 @@
<view class="evaluateBox" wx:for="{{infoList}}" wx:if="{{infolist!==0}}">
<view class="evaluateInfo">
<view class="userImg" style="display:inline-block" wx:if="{{item.anonymous==0}}">
<image src="{{item.wxHeadImg}}"> </image>
<image src="{{item.wxHeadImg}}" mode="aspectFill"> </image>
</view>
<view class="userImg" style="display:inline-block" wx:if="{{item.anonymous==1}}">
<image src="/images/nimingtouxiang.png"> </image>
<image src="/images/nimingtouxiang.png" mode="aspectFill"> </image>
</view>
<view class="userName" style="display:inline-block" >{{item.wxName}}</view>
</view>
... ... @@ -120,7 +120,7 @@
</view>
<view class="bottom_left_item" catchtap="collection">
<view class="collectIcon">
<image src='{{"goodsData.keep==false"?"/images/01-03/shoucang.png":"/images/01-03/shoucang.png"}}'></image>
<image src='{{goodsData.keep==false?"/images/01-03/unshoucang.png":"/images/01-03/shoucang.png"}}'></image>
<view class="collecttext">{{goodsData.keep==false?"收藏":"已收藏"}}</view>
</view>
<!-- <view wx:if="{{goodsData.keep==true}}">
... ... @@ -148,39 +148,6 @@
</view>
</view>
<!-- 加入购物车弹框 -->
<!-- <view class="mask" catchtap="closeMask" wx:if='{{showMask}}'>
<view class="diceng" catchtap="openMask">
<view class="info">
<image src="{{goodsData.goodsBanners[idx]}}"></image>
<view class="info_right">
<view class="info_price">¥{{goodsData.list[idx].goodsPrice}}</view>
<view class="info_stock">库存:{{goodsData.list[idx].goodsStock}}件</view>
<view class="info_stock" wx:if='{{info.detai.spec_type=="20"}}'>请选择规格</view>
</view>
</view>
<view class="attr" wx:if='{{info.detail.spec_type=="20"}}' wx:for='{{info.specData.spec_attr}}' wx:key='index'>
<view>{{item.group_name}}</view>
<view class="attr_main">
<view class="attr_item {{cell.flag?'activity':''}}" wx:for='{{item.spec_items}}' wx:for-item='cell'
wx:for-index='cellindex' wx:key='{{cellindex}}' data-index='{{index}}' data-cellindex='{{cellindex}}'
catchtap="changeAttrNum">{{cell.spec_value}}</view>
</view>
</view>
<view>
</view>
<view class="pay_count">
<view>购买数量</view>
<view class="count_box">
<view class="count_jian" catchtap="decNum">-</view>
<view class="real_count">{{count}}</view>
<view class="count_jian" catchtap="addNum">+</view>
</view>
</view>
<view class="confrimBtn" catchtap="confrimCart">确定</view>
<view class="btn" wx:if='{{type==1}}' catchtap="jiagou">加入购物车</view>
<view class="btn" wx:if='{{type==2}}' catchtap="lijigoumai">立即购买</view>
</view>
</view> -->
<view class="mask" catchtap="closeMask" wx:if='{{showMask}}'>
<view class="diceng" catchtap="openMask">
<view class="info">
... ...
... ... @@ -13,7 +13,7 @@
<!-- 商品详情 -->
<view class="bottom">
<view class="productPic">
<image src="{{item.listGoodsVoList[0].goodsPic}}"></image>
<image src="{{item.listGoodsVoList[0].goodsPic}}" mode="aspectFill"></image>
</view>
<view class="productDetail">
<view class="name">{{item.listGoodsVoList[0].goodsName}}</view>
... ...
... ... @@ -7,11 +7,7 @@ Page({
goodsId: '',
searchBox: true,
keyWord: '',
labelArray: [{
title: '苹果'
}, {
title: '香蕉'
}],
labelArray: [], //搜索历史
title: '猜你喜欢',
list: [],
bottomHint:false //触底提示
... ... @@ -34,19 +30,16 @@ Page({
url: '/pages/home/home',
})
},
//取消文本框输入
cancel() {
this.setData({
keyWord: '',
})
},
//取消搜索
unsearch() {
wx.switchTab({
url: '/pages/home/home',
})
},
//搜索历史
searchHistory() {
method.getRequest("/coupon/historySearch", data => {
if (data.statusCode == 0) {
... ...
<!--pages/search/search.wxml-->
<view class="container">
<view class="search_center" catchtap="goSearch">
<!-- <view class="real_search_center">
<view class="searchIcon">
<image src="/images/01-02/sousuo.png"></image>
</view>
<input class="weui-input" auto-focus placeholder="搜索" bindinput="getKeyWord" placeholder-class="placeholder" bindconfirm="search"/>
<view class="searchIcon" bindtap="cancel">
<image src="/images/01-02/quxiao.png"></image>
</view>
</view>
<view class="search_right" catchtap="unsearch">取消</view> -->
<van-search value="{{keyWord}}" placeholder="请输入搜索关键词" shape="round" show-action bind:search="search"
bind:cancel="onCancel" bind:change="onChange" />
</view>
... ... @@ -42,7 +32,7 @@
<view class="listTable">
<view class="listSon" wx:for="{{list}}" bindtap="goGoodsDetail" data-id="{{item.goodsId}}">
<view class="listPic">
<image src="{{item.goodsImg}}"></image>
<image src="{{item.goodsImg}}" mode="aspectFill"></image>
</view>
<view class="listTitle">{{item.goodsName}}</view>
<view class="collect">{{item.goodsAttributes}}</view>
... ...
... ... @@ -15,7 +15,7 @@
<view class="pickContent">
<view class="pickItem" wx:for="{{list}}" data-id="{{item.goodsId}}" bindtap="goGoodsDetail">
<view class="pickPic">
<image src="{{item.goodsImg}}"></image>
<image src="{{item.goodsImg}}" mode="aspectFill"></image>
</view>
<view class="pickTitle">{{item.goodsName}}</view>
<view class="pickDesc">{{item.goodsAttributes}}</view>
... ...
... ... @@ -2,7 +2,7 @@
let method = require("../../utils/reuqest.js")
Page({
data: {
default: true,
default: true, //默认地址
defaultType: '',
list: [],
exceedRange: true,
... ...
... ... @@ -4,25 +4,16 @@ const util = require("../../utils/util.js")
Page({
data: {
Authorization: false, //判断用户是否登录
showTime: false, //配送时间
// storePickupTime: '',
userData: "", //地址信息
addHint: false, //判断有没有地址
showTime: false, //配送时间
timers: '',
checkType: 1,
userData: "",
addHint: false, //判断有没有地址
startTime: '', //日历选择获取当天日期
date: '',
cartList: [],
buyData: {
price: 100
},
checkNum: 0,
checkNum: 0,
stockNum: '',
// 购物车
goodsId: '', //商品id
goodsId: '', //商品id
goodsNum: '', //商品数量
carts: [], // 购物车列表
carts: [], // 购物车列表
pitchCart: [], //选中商品
pitchList: [], //选中商品id
hasList: false, // 列表是否有数据
... ... @@ -33,7 +24,7 @@ Page({
name: "hello"
},
title: '产品推荐',
bottomHint: false, //上拉提示
bottomHint: false, //触底提示
flagClick: wx.getStorageSync('selecClick')
},
//登录
... ... @@ -91,9 +82,6 @@ Page({
},
//地址信息
getAddress() {
// if (wx.getStorageSync('addIndex')) {
// wx.removeStorageSync('addIndex')
// }
let index = wx.getStorageSync('addIndex')
method.getRequest("/address", data => {
if (data.statusCode == 0) {
... ... @@ -258,8 +246,6 @@ Page({
return false;
} else {
num = num + 1;
// console.log(num,'num')
// console.log(carts[index],'index')
carts[idx].num = num;
this.setData({
carts: carts
... ... @@ -331,7 +317,7 @@ Page({
})
},
//立即购买
immediatelyPay() {
immediatelyPay: util.throttle(function () {
if (this.data.checkNum == 0) {
wx.showToast({
title: '未选择购买商品',
... ... @@ -365,7 +351,7 @@ Page({
wx.setStorageSync('pitchList', this.data.pitchList)
wx.setStorageSync('pitchCart', this.data.pitchCart)
}
},
}, 3000),
//购物车为空
goHome() {
wx.switchTab({
... ... @@ -396,7 +382,6 @@ Page({
onShow: function () {
this.getTotalPrice();
this.getAddress() //获取默认地址
this.getDayTime() //获取当前日期
this.setData({ //每次购物车下单重新选择商品
pitchCart: [],
pitchList: []
... ...
... ... @@ -29,9 +29,6 @@
</view>
{{timers.length ? timers : ''}}
</view>
<!-- <view class="arrow1" style="width:94%">
<image src="/images/04-01/arrow.png"></image>
</view> -->
<view class="section">
<van-popup show="{{ showTime }}" bind:close="onClose" position="bottom">
<timepicker deliveryTime='{{deliveryTime}}' bind:selectTime="selectTime" id="timePicker"></timepicker>
... ... @@ -49,7 +46,7 @@
catchtap="selectList" />
<icon wx:else type="circle" class="cart-pro-select" data-index="{{index}}" catchtap="selectList" />
<navigator url="../details/details?id={{item.id}}">
<image class="cart-thumb" src="{{item.goodsImg}}"></image>
<image class="cart-thumb" src="{{item.goodsImg}}" mode="aspectFill"></image>
</navigator>
<text class="cart-pro-name">{{item.goodsName}}</text>
<text class="cart-pro-desc">{{item.goodsAttributes}}</text>
... ... @@ -81,7 +78,7 @@
<view class="listTable">
<view class="listSon" wx:for="{{list}}" bindtap="goGoodsDetail" data-id="{{item.goodsId}}">
<view class="listPic">
<image src="{{item.goodsImg}}"></image>
<image src="{{item.goodsImg}}" mode="aspectFill"></image>
</view>
<view class="listTitle">{{item.goodsName}}</view>
<view class="collect">{{item.goodsAttributes}}</view>
... ... @@ -100,9 +97,6 @@
</view>
<!-- 立即购买 -->
<view class="bottom">
<!-- <view class="checkPic">
<image src="/images/04-01/uncheck.png"></image>
</view> -->
<view class="checkText">
已选({{checkNum}})
</view>
... ...
<!--pages/timedmo/timedmo.wxml-->
 <view bindtap='chooseTime'>自提时间{{timers.length ? timers : ''}}</view>
<van-popup show="{{ showTime }}" bind:close="onClose" position="bottom" style="display:{{showTime ? 'vilative' : 'none'}}">
<timepicker deliveryTime='{{deliveryTime}}' bind:selectTime="selectTime" id="aaa" bind:selectTimes="selectTime"></timepicker>
<timepicker bind:selectTime="selectTime" id="aaa" bind:selectTimes="selectTime"></timepicker>
</van-popup>
\ No newline at end of file
... ...
... ... @@ -18,9 +18,6 @@
登录/注册
</view>
</view>
<!-- <view class="arrow">
<image src="/images/05-01/arrow.png"></image>
</view> -->
</view>
<view class="container">
<!-- 全部订单 -->
... ...
... ... @@ -52,6 +52,10 @@
font-size: 36rpx;
font-weight: 500;
color: #ffffff;
width: 520rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.decribe {
... ...
... ... @@ -26,10 +26,7 @@ function getDates(days, todate = new Date()) { //todate暺恕敶
}
return dateArry;
}
/**
* 传入时间后几天
* param:传入时间:dates:"2018-04-02",later:往后多少天
*/
//传入时间后几天 param:传入时间:dates:"2018-04-02",later:往后多少天
function dateLater(dates, later) {
let dateObj = {};
let show_day = new Array('周日', '周一', '周二', '周三', '周四', '周五', '周六');
... ... @@ -66,55 +63,70 @@ function getUser(msg) {
url: '/pages/index/index',
})
}
//获取位置信息
function getLocation(that) {
wx.getLocation({
type: 'wgs84',
success: function (res) {
// 经纬度
var latitude = res.latitude
var longitude = res.longitude
var aK = that.data.aK
wx.request({
url: 'https://api.map.baidu.com/geocoder/v2/?ak=' + aK + '&location=' + latitude + ',' + longitude + '&output=json',
data: {},
header: {
'content-type': 'application/json'
},
success: function (res) {
var city = res.data.result.addressComponent.city;
that.setData({
currentCity: city
})
wx.request({
url: 'xxx' + city,
data: {},
header: {
'content-type': 'application/json'
},
success: function (res) {
that.setData({
county: res.data,
})
},
})
}
})
//防抖
function throttle(fn, gapTime) {
if (gapTime == null || gapTime == undefined) {
gapTime = 1500
}
},
fail: function () {
wx.showToast({
title: '授权失败',
icon: 'success',
duration: 1000
})
let _lastTime = null;
return function () {
let _nowTime = +new Date()
if (_nowTime - _lastTime > gapTime || !_lastTime) {
fn.apply(this, arguments) //将this和参数传给原函数
_lastTime = _nowTime
}
})
}
}
// //获取位置信息
// function getLocation(that) {
// wx.getLocation({
// type: 'wgs84',
// success: function (res) {
// // 经纬度
// var latitude = res.latitude
// var longitude = res.longitude
// var aK = that.data.aK
// wx.request({
// url: 'https://api.map.baidu.com/geocoder/v2/?ak=' + aK + '&location=' + latitude + ',' + longitude + '&output=json',
// data: {},
// header: {
// 'content-type': 'application/json'
// },
// success: function (res) {
// var city = res.data.result.addressComponent.city;
// that.setData({
// currentCity: city
// })
// wx.request({
// url: 'xxx' + city,
// data: {},
// header: {
// 'content-type': 'application/json'
// },
// success: function (res) {
// that.setData({
// county: res.data,
// })
// },
// })
// }
// })
// },
// fail: function () {
// wx.showToast({
// title: '授权失败',
// icon: 'success',
// duration: 1000
// })
// }
// })
// }
module.exports = {
formatTime: formatTime,
onReachListData: onReachListData,
getUser: getUser,
getDates: getDates,
getLocation:getLocation
throttle: throttle
}
\ No newline at end of file
... ...