作者 liaolinfeng

全部完成

正在显示 54 个修改的文件 包含 1692 行增加914 行删除

要显示太多修改。

为保证性能只显示 54 of 54+ 个文件。

... ... @@ -2,8 +2,10 @@
import md5 from 'utils/MD5.js'
App({
onLaunch: function () {
},
post(url,data){
/**
* 自定义post函数,返回Promise
... ... @@ -20,7 +22,7 @@ App({
var promise = new Promise((resolve, reject) => {
let that=this;
let postData=data;
let baseurl ='http://phonemall.wx.broteam.cn/portal/';
let baseurl ='https://phonemall.wx.broteam.cn/portal/';
//发起网络请求
wx.request({
url: baseurl+url,
... ... @@ -65,8 +67,8 @@ App({
dateObj.dataday = date.getFullYear() + '-' + ((date.getMonth() + 1) < 10 ? ("0" + (date.getMonth() + 1)) : date.getMonth() + 1) + '-' + (date.getDate() < 10 ? ("0" + date.getDate()) : date.getDate());
dateObj.houser = date.getHours();//当前时间点
console.log(date.getHours())
dateObj.housers = (date.getHours() < 10 ? ("0" + date.getHours()) : date.getHours() + 1) + ':00:00';//当前时间点
dateObj.datadayhouser = date.getFullYear() + '/' + ((date.getMonth() + 1) < 10 ? ("0" + (date.getMonth() + 1)) : date.getMonth() + 1) + '/' + (date.getDate() < 10 ? ("0" + date.getDate()) : date.getDate()) + ' ' + (date.getHours() < 10 ? ("0" + date.getHours() ) : date.getHours() + 1)+':00';//当前时间并时间点
dateObj.housers = (date.getHours() < 10 ? ("0" + date.getHours()) : date.getHours()) + ':00:00';//当前时间点
dateObj.datadayhouser = date.getFullYear() + '/' + ((date.getMonth() + 1) < 10 ? ("0" + (date.getMonth() + 1)) : date.getMonth() + 1) + '/' + (date.getDate() < 10 ? ("0" + date.getDate()) : date.getDate()) + ' ' + (date.getHours() < 10 ? ("0" + date.getHours() ) : date.getHours() )+':00';//当前时间并时间点
return dateObj;
},
// 数组移除指定元素
... ... @@ -79,11 +81,13 @@ App({
let str = 'bronet' + strtime + 'beijing'
return md5(md5(str))
},
globalData: {
userInfo: null,
users_id:'',
openid:'',
type:'',
access: ''//1:普通用户,2:后台管理
access: '',//1:普通用户,2:后台管理
cartnum:''//购物车数数量
}
})
\ No newline at end of file
... ...
... ... @@ -2,14 +2,15 @@
"pages": [
"pages/start/start",
"pages/index/index",
"pages/backStage/addgoods/addgoods",
"pages/secondsKill/secondsKill",
"pages/backStage/orderDetail/orderDetail",
"pages/backStage/seckill/seckill",
"pages/backStage/orderManagement/orderManagement",
"pages/backStage/vipManagementDetail/vipManagementDetail",
"pages/backStage/vipManagement/vipManagement",
"pages/backStage/chooseTime/chooseTime",
"pages/backStage/batchManagement/batchManagement",
"pages/backStage/addgoods/addgoods",
"pages/backStage/goodsManagement/goodsManagement",
"pages/backStage/index/index",
"pages/spare/orderStateDetail/orderStateDetail",
... ...
.nodata{
font-size:30rpx;
text-align: center;
color:#999;
margin:50% 0 0 0;
}
.list_img .img_no {
position:absolute;
top:58rpx;
left:49rpx;
width:119rpx;
height:100rpx;
overflow:hidden;
}
.list_img .item_imgbox {
position:absolute;
top:0;
right:0;
width:80rpx;
height:80rpx;
overflow:hidden;
.list_img{
padding: 0 30rpx;
}
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p,
blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img,
ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center,
... ... @@ -60,27 +81,7 @@ li {
list-style: none;
}
/* ::-webkit-scrollbar {
width: 5px;
height: 5px;
}
::-webkit-scrollbar-track-piece {
background-color: rgba(0, 0, 0, 0.2);
-webkit-border-radius: 6px;
}
::-webkit-scrollbar-thumb:vertical {
height: 5px;
background-color: rgba(125, 125, 125, 0.7);
-webkit-border-radius: 6px;
}
::-webkit-scrollbar-thumb:horizontal {
width: 5px;
background-color: rgba(125, 125, 125, 0.7);
-webkit-border-radius: 6px;
} */
body {
-webkit-text-size-adjust: none;
... ... @@ -101,8 +102,6 @@ input, textarea {
}
/** 字体图标 **/
@font-face {
font-family: 'iconfont'; /* project id 783186 */
... ...
... ... @@ -22,28 +22,35 @@ Page({
Time_node: [], //秒杀时间节点
Time_nodeid: '', //秒杀时间点Id
TimeIntervaldata: '', //秒杀时间段
addnewarr: [],//新旧程度
addnewarr: [], //新旧程度
addnew: [],
addnewid: '', //新旧程度id
SalesType: [],
SalesTypetab: [],//销售专区
SalesTypeid:'',//销售专区id
SalesTypetab: [], //销售专区
SalesTypeid: '', //销售专区id 1新品推荐,2秒杀专场,3降价销售
showmain: true, //true现在主要内容,flase商品详情
imgsnum: [1, 2, 3, 4],
thumbnail: '', //商品缩略图
thumbnailup:'',
thumbnailup: '',
name: '', //商品名称
price: '', //商品价格
num: '', //商品数量
num: 1, //商品数量
color: '', //商品颜色
version: '', //版本号
memory: '', //商品内存
detail: '', //商品详情
banner: [], //商品图集
date: '', //秒杀日期
downprice:'',
downprice: '',
bannerimgs: [],
newdate:''
newdate: '',
indexone: '',
indextwo: '',
indexthree: '',
indexfour: '',
indextime: '',
indextype: '',
indexnew: ''
},
setname(e) {
this.setData({
... ... @@ -53,13 +60,13 @@ Page({
setprice(e) {
this.setData({
price: e.detail.value,
})
},
setdownprice(){
this.setData({
downprice:e.detail.value
})
setdownprice(e) {
this.setData({
downprice: e.detail.value
})
},
setnumber(e) {
this.setData({
... ... @@ -86,7 +93,7 @@ Page({
detail: e.detail.value
})
},
chargePicker(e){
chargePicker(e) {
let indexone = e.detail.value
let that = this;
let classifyone = that.data.classifyone;
... ... @@ -130,30 +137,29 @@ Page({
console.log(e)
let that = this;
let TimeIntervaldata = that.data.TimeIntervaldata;
let Time_nodeid = TimeIntervaldata[e.detail.value];
let Time_nodeid = TimeIntervaldata[e.detail.value].id;
that.setData({
indextime: e.detail.value,
Time_nodeid: Time_nodeid
})
},
bindRegionChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
region: e.detail.value
})
},
chargePickertype(e){
let that=this;
chargePickertype(e) {
let that = this;
let SalesType = that.data.SalesType;
let SalesTypeid = SalesType[e.detail.value].id;
that.setData({
indextype:e.detail.value,
indextype: e.detail.value,
SalesTypeid: SalesTypeid
})
},
chargePickeraddnew(e) {
let that = this;
let indexnew = parseInt(e.detail.value)
let indexnew = parseInt(e.detail.value)
let addnewarr = that.data.addnewarr;
let addnewid = addnewarr[indexnew].id
that.setData({
... ... @@ -172,7 +178,19 @@ Page({
}
that.setData({
classifyone: res.data.data,
classifyonePicker: classifyonePicker
classifyonePicker: classifyonePicker,
classifytwo: [],
classifytwoPicker: [],
classifytwoid: '',
classifythree: [],
classifythreePicker: [],
classifythreeid: '',
classifyfour: [],
classifyfourPicker: [],
classifyfourid: '',
indextwo: '',
indexthree: '',
indexfour: ''
})
}
}).catch((errMsg) => {
... ... @@ -186,7 +204,6 @@ Page({
parentID: parentID
}
app.post(url, params).then((res) => {
console.log(res)
if (res.data.code == 200) {
let classifytwoPicker = []
for (let obj of res.data.data) {
... ... @@ -194,10 +211,17 @@ Page({
}
that.setData({
classifytwo: res.data.data,
classifytwoPicker: classifytwoPicker
classifytwoPicker: classifytwoPicker,
classifythree: [],
classifythreePicker: [],
classifythreeid: '',
classifyfour: [],
classifyfourPicker: [],
classifyfourid: '',
indexthree: '',
indexfour: '',
})
console.log(that.data.classifytwo)
console.log(that.data.classifytwoPicker)
}
}).catch((errMsg) => {
console.log(errMsg)
... ... @@ -210,7 +234,6 @@ Page({
parentID: parentID
}
app.post(url, params).then((res) => {
console.log(res)
if (res.data.code == 200) {
let classifythreePicker = []
for (let obj of res.data.data) {
... ... @@ -218,7 +241,11 @@ Page({
}
that.setData({
classifythree: res.data.data,
classifythreePicker: classifythreePicker
classifythreePicker: classifythreePicker,
classifyfour: [],
classifyfourPicker: [],
classifyfourid: '',
indexfour: '',
})
}
}).catch((errMsg) => {
... ... @@ -232,7 +259,7 @@ Page({
parentID: parentID
}
app.post(url, params).then((res) => {
console.log(res)
if (res.data.code == 200) {
let classifyfourPicker = []
for (let obj of res.data.data) {
... ... @@ -251,10 +278,10 @@ Page({
uploadImages() {
let that = this;
wx.chooseImage({
count: 8,
count: 8 - that.data.bannerimgs.length,
sizeType: ['original', 'compressed'],
success: function(res) {
console.log(res)
let successUp = 0; //成功个数
let failUp = 0; //失败个数
let i = 0; //第几个
... ... @@ -272,7 +299,6 @@ Page({
})
},
uploadAllfile(filePaths, successUp, failUp, i, length) {
let that = this
let url = 'http://phonemall.wx.broteam.cn/portal/Goodsmanage/addGoodsFile'
wx.uploadFile({
... ... @@ -283,19 +309,19 @@ Page({
success: function(res) {
wx.hideNavigationBarLoading()
wx.hideLoading()
console.log(res)
let data = JSON.parse(res.data);
console.log(data)
let imgTemp = that.data.bannerimgs;
let banner = that.data.banner;
let data = JSON.parse(res.data);
let imgTemp = that.data.bannerimgs;
let banner = that.data.banner;
if (imgTemp.length < 8) {
imgTemp.push(data.data.filename);
banner.push(data.data.name)
console.log(data.data.name)
that.setData({
bannerimgs: imgTemp,
banner: banner
})
}
if (banner.length < 8) {
banner.push(data.data.name);
}
that.setData({
bannerimgs: imgTemp,
banner: banner
})
},
fail: function(res) {
wx.hideNavigationBarLoading()
... ... @@ -318,7 +344,7 @@ Page({
wx.chooseImage({
count: 1,
success: (res) => {
console.log(res)
var tempFilePaths = res.tempFilePaths
wx.uploadFile({
url: 'http://phonemall.wx.broteam.cn/portal/Goodsmanage/addGoodsFile', //仅为示例,非真实的接口地址
... ... @@ -326,7 +352,7 @@ Page({
name: 'file',
formData: {},
success: function(res) {
console.log(res)
var data = JSON.parse(res.data);
var picurl = data.data.filename;
that.setData({
... ... @@ -338,7 +364,29 @@ Page({
}
})
},
//上传图片接口调取
//取消多图上传
coloebanner(e) {
let that = this;
let index = parseInt(e.currentTarget.dataset.index);
let bannerimgs = that.data.bannerimgs;
let banner = that.data.banner;
let tem = [];
let temimgs = [];
for (let i in bannerimgs) {
if (i != index) {
temimgs.push(bannerimgs[i])
}
}
for (let j in banner) {
if (j != index) {
tem.push(banner[j])
}
}
that.setData({
bannerimgs: temimgs,
banner: tem
})
},
setshowmain_flose() {
wx.setNavigationBarTitle({
title: '详情设置',
... ... @@ -348,20 +396,20 @@ Page({
})
},
setshowmain_true() {
let that=this;
if (that.data.banner.length==0){
let that = this;
if (that.data.banner.length == 0) {
wx.showToast({
title: '请上传图',
icon: 'none',
duration: 2000,
})
}else if(that.data.detail==''){
} else if (that.data.detail == '') {
wx.showToast({
title: '请输入详情',
icon: 'none',
duration: 2000,
})
}else{
} else {
wx.setNavigationBarTitle({
title: '添加商品',
})
... ... @@ -370,29 +418,7 @@ Page({
})
}
},
//取消多图上传
coloebanner(e){
let that=this;
let index = parseInt(e.currentTarget.dataset.index);
let bannerimgs = that.data.bannerimgs;
let banner = that.data.banner;
let tem=[];
let temimgs = [];
for (let i in bannerimgs){
if (i != index){
temimgs.push(bannerimgs[i])
}
}
for (let j in banner){
if (j != index) {
tem.push(banner[j])
}
}
that.setData({
bannerimgs: temimgs,
banner: tem
})
},
//设置tag
settag0() {
let tag = this.data.tag;
... ... @@ -440,7 +466,7 @@ Page({
},
bindDateChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
this.setData({
date: e.detail.value
})
... ... @@ -460,7 +486,7 @@ Page({
TimeIntervaldata: TimeIntervaldata,
Time_node: Time_node
})
}
}).catch((errMsg) => {
console.log(errMsg)
... ... @@ -468,46 +494,46 @@ Page({
},
addgoods() {
let that = this;
let tab=false;
let label = {};
let tag = that.data.tag // [0, 0, 1, 1],tag[0]=0原装,tag[0]=1非原装,tag[1]=0在保,tag[1]=1出报,tag[2]=0选择全套包装,tag[3]=0更换外屏
if (tag[0] == 0) {
label.is_original= "原装"
label.is_original = "原装"
} else {
label.is_original= '非原装'
label.is_original = '非原装'
}
if (tag[1] == 0) {
label.is_protect= '在保'
} else {
label.is_protect='出保'
if (tag[1] == 0) {
label.is_protect = '在保'
} else {
label.is_protect = '出保'
}
if (tag[2] == 0) {
label.all= '全套包装'
label.all = '全套包装'
}
if (tag[3] == 0) {
label.screen= '更换外屏'
label.screen = '更换外屏'
}
console.log(that.data.name)
if (that.data.thumbnailup == '' ){
if (that.data.thumbnailup == '') {
wx.showToast({
title: '请上传图片',
icon: 'none',
duration:2000,
duration: 2000,
})
} else if (that.data.name == ''){
} else if (that.data.name == '') {
wx.showToast({
title: '名称必填',
icon: 'none',
duration: 2000,
})
} else if (that.data.price ==''){
} else if (that.data.price == '') {
wx.showToast({
title: '价格必填',
icon: 'none',
duration: 2000,
})
}else if (that.data.num == '') {
} else if (that.data.num == '') {
wx.showToast({
title: '数量必填',
icon: 'none',
... ... @@ -537,39 +563,77 @@ Page({
icon: 'none',
duration: 2000,
})
} else if(that.data.SalesTypeid == '') {
} else if (that.data.SalesTypeid == '') {
wx.showToast({
title: '销售类型必填',
icon: 'none',
duration: 2000,
})
} else if (that.data.addnewid == '') {
wx.showToast({
title: '新旧程度必填',
icon: 'none',
duration: 2000,
})
} else if ((that.data.banner == []) && (that.data.detail == '') ) {
wx.showToast({
title: '请完善详情',
icon: 'none',
duration: 2000,
})
} else{
console.log(that.data.banner)
} else if (that.data.SalesTypeid) {
if (that.data.SalesTypeid == '2') {
if (that.data.date == '') {
wx.showToast({
title: '秒杀日期必填',
icon: 'none',
duration: 2000
})
} else if (that.data.Time_nodeid == '') {
wx.showToast({
title: '秒杀时间必填',
icon: 'none',
duration: 2000
})
}else{
tab = true;
}
} else if(that.data.SalesTypeid == '3') {
if (that.data.downprice == '') {
wx.showToast({
title: '请填写商品降价',
icon: 'none',
duration: 2000
})
} else if (parseInt(that.data.downprice) >= parseInt(that.data.price)) {
wx.showToast({
title: '降价应小于原价',
icon: 'none',
duration: 2000
})
}else{
tab = true;
}
}else{
tab=true;
}
}
if (tab){
if (that.data.addnewid == '') {
wx.showToast({
title: '新旧程度必填',
icon: 'none',
duration: 2000,
})
} else if ((that.data.banner == []) || (that.data.detail == '')) {
wx.showToast({
title: '请完善详情',
icon: 'none',
duration: 2000,
})
}else{
let params = {
name: that.data.name,
thumbnail: that.data.thumbnailup,
banner: JSON.stringify(that.data.banner),
details: that.data.detail,
price: that.data.price,
special_price: that.data.downprice,
Sales_type: that.data.SalesTypeid,
number: that.data.num,
special_time_between: that.data.addnewid,
special_time_between: that.data.Time_nodeid,
special_time_day: that.data.date,
color: that.data.color,
version: that.data.version,
memory: that.data.memory,
memory: that.data.memory + 'G',
type: that.data.classifyoneid,
system: that.data.classifytwoid,
brand: that.data.classifythreeid,
... ... @@ -596,18 +660,19 @@ Page({
}
}).catch((errMsg) => {
console.log(errMsg)
})
}
})
}
}
},
//获取新旧程度
getDegree(){
let that=this;
let url ='goods/getDegree';
app.post(url,{}).then((res)=>{
if(res.data.code==200){
getDegree() {
let that = this;
let url = 'goods/getDegree';
app.post(url, {}).then((res) => {
if (res.data.code == 200) {
let addnewarr = res.data.data;
let addnew=[];
for (let obj of addnewarr){
let addnew = [];
for (let obj of addnewarr) {
addnew.push(obj.degree)
}
that.setData({
... ... @@ -615,20 +680,20 @@ Page({
addnew: addnew
})
}
}).catch((errMsg)=>{
}).catch((errMsg) => {
console.log(errMsg)
})
},
//获取销售类型
getSalesType(){
let that=this;
let url ='Goodsmanage/getSalesType';
app.post(url,{}).then((res)=>{
console.log(res)
if(res.data.code==200){
let SalesType=res.data.data;
let SalesTypetab=[];
for (let obj of SalesType){
getSalesType() {
let that = this;
let url = 'Goodsmanage/getSalesType';
app.post(url, {}).then((res) => {
if (res.data.code == 200) {
let SalesType = res.data.data;
let SalesTypetab = [];
for (let obj of SalesType) {
SalesTypetab.push(obj.type)
}
that.setData({
... ... @@ -637,7 +702,7 @@ Page({
})
}
}).catch((errMsg)=>{
}).catch((errMsg) => {
console.log(errMsg)
})
... ... @@ -650,13 +715,12 @@ Page({
this.getseckill();
this.getDegree();
this.getSalesType();
let newdate=new Date();
let date = new Date();
let newdate = date.getFullYear() + '-' + ((date.getMonth() + 1) < 10 ? ("0" + (date.getMonth() + 1)) : date.getMonth() + 1) + '-' + (date.getDate() < 10 ? ("0" + date.getDate()) : date.getDate());
this.setData({
newdate: newdate
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ... @@ -668,9 +732,16 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function() {
// this.getclassifydataone();
this.getseckill();
this.getDegree();
this.getSalesType();
let date = new Date();
let newdate = date.getFullYear() + '-' + ((date.getMonth() + 1) < 10 ? ("0" + (date.getMonth() + 1)) : date.getMonth() + 1) + '-' + (date.getDate() < 10 ? ("0" + date.getDate()) : date.getDate());
this.setData({
newdate: newdate
})
},
/**
* 生命周期函数--监听页面隐藏
*/
... ... @@ -682,7 +753,9 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
wx.reLaunch({
url: '../start/start'
})
},
/**
... ...
... ... @@ -33,7 +33,7 @@
</view>
<view class='list_input'>
<input placeholder='请输入价格' bindinput='setprice'
value='{{price}}'></input>
value='{{price}}' type='number' ></input>
<text class='unit'>元</text>
</view>
</view>
... ... @@ -43,7 +43,7 @@
</view>
<view class='list_input'>
<input placeholder='请输入商品数量' bindinput='setnumber'
value='{{number}}'></input>
value='{{num}}' type='number'></input>
<text class='unit'>个</text>
</view>
</view>
... ... @@ -70,7 +70,8 @@
</view>
<view class='list_input'>
<input placeholder='请输入内存' bindinput='setmemory'
value='{{memory}}'></input>
value='{{memory}}' type='number'></input>
<text class='unit'>G</text>
</view>
</view>
<picker value='{{indexone}}' range='{{classifyonePicker}}' bindchange='chargePicker' class='picker'>
... ... @@ -118,7 +119,7 @@
<text class='unit'>元</text>
</view>
</view>
<picker mode="date" value="{{date}}" start="newdate" end="2056-12-30" bindchange="bindDateChange" class='picker' wx:if='{{SalesTypeid==2}}'>
<picker mode="date" value="{{date}}" start="{{newdate}}" bindchange="bindDateChange" class='picker' wx:if='{{SalesTypeid==2}}'>
<view class='item_list'>
<view class='list_title'>秒杀日期</view>
<view class='list_name'>{{date}}</view>
... ... @@ -175,7 +176,7 @@
</view>
<image src='{{item}}'></image>
</view>
<view class='upload_boxs' bindtap='uploadImages' wx:if='{{ bannerimgs.length<=8 }}'>
<view class='upload_boxs' bindtap='uploadImages' wx:if='{{ bannerimgs.length<8}}'>
<block wx:if=''>
<image src=''></image>
</block>
... ...
... ... @@ -10,7 +10,7 @@ page {
}
.item_list {
width:100%;
background: #fff;
padding: 35rpx;
margin-bottom: 16rpx;
... ... @@ -18,7 +18,10 @@ page {
align-items: center;
justify-content: space-between;
}
.picker .item_list{
justify-content: left;
width:680rpx;
}
.item_list:last-child {
margin-bottom: 0;
}
... ... @@ -130,7 +133,7 @@ page {
.bottom_btn {
position: fixed;
z-index:100;
bottom:0;
bottom:20rpx;
left:20rpx;
width: 708rpx;
height: 88rpx;
... ... @@ -204,12 +207,12 @@ border-radius:50%;
height: 100%;
}
.txt_box{
height: 600rpx;
height: 400rpx;
font-size:30rpx;
}
.txt_box textarea{
padding:40rpx 0 0 0;
height: 600rpx;
height: 200rpx;
width:100%;
}
.text_tag{
... ...
... ... @@ -2,7 +2,7 @@
const app=getApp();
Page({
/**
* 页面的初始数据
* 页面的初始
*/
data: {
goodstype: '', //type=1是新品推荐。type=3是降价专区。type=2是秒杀专区,1,3不用输入时间。2需要输入时间
... ... @@ -81,7 +81,6 @@ Page({
that.setflag();
},
setifshowjj_flase(){
this.setData({
ifshowjj: false
})
... ... @@ -113,7 +112,7 @@ Page({
putin(){
let that=this;
let batchstatus = that.data.batchstatus;
if (batchstatus==200){
if (batchstatus==1){
that.setmoveNewGoods();
} else if (batchstatus == 2){
that.setmoveSnapUp();
... ... @@ -131,38 +130,47 @@ Page({
goods_id +=obj.id+','
}
}
let url ='Goodsmanage/moveSnapUp';
let param={
goods_id: goods_id,
day:that.data.day,
time:that.data.time_id
}
app.post(url, param).then((res)=>{
console.log(res)
if(res.data.code==200){
wx.showToast({
title: "已添加至秒杀专场",
icon:'success',
duration:2000
})
setTimeout(function () {
wx.navigateTo({
url: '../goodsManagement/goodsManagement',
success: function (res) { },
fail: function (res) { },
complete: function (res) { },
})
}, 2000)
}else{
wx.showToast({
title: "操作失败",
icon: 'none',
duration: 2000
})
if (that.data.time_id==''){
wx.showToast({
title: '请选择秒杀时间',
icon:'none',
duration:2000
})
}else{
let url = 'Goodsmanage/moveSnapUp';
let param = {
goods_id: goods_id,
day: that.data.day,
time: that.data.time_id
}
}).catch((errMsg)=>{
console.log(errMsg)
})
app.post(url, param).then((res) => {
console.log(res)
if (res.data.code == 200) {
wx.showToast({
title: "已添加至秒杀专场",
icon: 'success',
duration: 2000
})
setTimeout(function () {
wx.redirectTo({
url: '../goodsManagement/goodsManagement',
success: function (res) { },
fail: function (res) { },
complete: function (res) { },
})
}, 1000)
} else {
wx.showToast({
title: "操作失败",
icon: 'none',
duration: 2000
})
}
}).catch((errMsg) => {
console.log(errMsg)
})
}
},
//批量至新品推荐
setmoveNewGoods(){
... ... @@ -175,7 +183,7 @@ Page({
}
}
let url ='Goodsmanage/moveNewGoods';
console.log(goods_id);
app.post(url,{
goods_id: goods_id
}).then((res)=>{
... ... @@ -191,13 +199,13 @@ Page({
duration: 2000
})
setTimeout(function () {
wx.navigateTo({
wx.redirectTo({
url: '../goodsManagement/goodsManagement',
success: function (res) { },
fail: function (res) { },
complete: function (res) { },
})
}, 2000)
}, 1000)
} else {
wx.showToast({
title: "操作失败",
... ... @@ -215,48 +223,65 @@ Page({
if (that.data.flag){
let allGoodsdata = that.data.allGoodsdata;
let goods_id = '';
let price='';
for (let obj of allGoodsdata) {
if (obj.selectstatus) {
goods_id += obj.id + ','
goods_id += obj.id + ',';
price = obj.price
}
}
let url = 'Goodsmanage/moveDiscount';
console.log(goods_id);
app.post(url, {
goods_id: goods_id,
special_price: that.data.special_price
}).then((res) => {
if (res.data.code == 200) {
that.setData({
false1: false,
batchstatus: 0
})
console.log(that.data.false1)
that.getdata(parseInt(that.data.goodstype));
wx.showToast({
title: "已添加至降价专场",
icon: 'success',
duration: 2000
})
setTimeout(function(){
wx.navigateTo({
url: '../goodsManagement/goodsManagement',
success: function(res) {},
fail: function(res) {},
complete: function(res) {},
if (parseFloat(that.data.special_price) >= parseFloat(price)){
wx.showToast({
title: '降价应该小于原价哟!',
icon: 'none',
duration: 2000,
})
} else if (parseFloat(that.data.special_price)==0){
wx.showToast({
title: '降价不能是0哟!',
icon: 'none',
duration: 2000,
})
}
else{
let url = 'Goodsmanage/moveDiscount';
app.post(url, {
goods_id: goods_id,
special_price: that.data.special_price
}).then((res) => {
if (res.data.code == 200) {
that.setData({
false1: false,
batchstatus: 0
})
console.log(that.data.false1)
that.getdata(parseInt(that.data.goodstype));
wx.showToast({
title: "已添加至降价专场",
icon: 'none',
duration: 2000
})
setTimeout(function () {
wx.redirectTo({
url: '../goodsManagement/goodsManagement',
success: function (res) { },
fail: function (res) { },
complete: function (res) { },
})
},2000)
} else {
wx.showToast({
title: "操作失败",
icon: 'none',
duration: 2000
})
}
}).catch((errMsg) => {
console.log(errMsg)
})
}, 1000)
} else {
wx.showToast({
title: "操作失败",
icon: 'none',
duration: 2000
})
}
}).catch((errMsg) => {
console.log(errMsg)
})
}
}
},
//批量至下架
... ... @@ -274,7 +299,7 @@ Page({
}
let url ='Goodsmanage/moveShelf'
app.post(url, params).then((res)=>{
if (res.data.code == 1) {
if (res.data.code == 200) {
that.setData({
false1: false,
batchstatus: 0,
... ... @@ -288,7 +313,7 @@ Page({
duration: 1000
})
setTimeout(function(){
wx.navigateTo({
wx.redirectTo({
url: '../goodsManagement/goodsManagement',
success: function(res) {},
fail: function(res) {},
... ... @@ -313,7 +338,6 @@ Page({
let that=this;
that.setData({
special_price:e.detail.value
})
},
//到选择时间
... ... @@ -330,12 +354,14 @@ Page({
let that=this;
let allGoodsdata = that.data.allGoodsdata;
let falsetag=false;
let goodstype = that.data.goodstype;
for (let obj of allGoodsdata){
if(obj.selectstatus){
falsetag=true;//有选中状态
}
}
if (falsetag){
that.setData({
false1: true
})
... ... @@ -439,10 +465,9 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
console.log(1)
let that = this;
if (options.goodstype != undefined) {
console.log(2)
that.setData({
goodstype: options.goodstype
})
... ... @@ -459,13 +484,11 @@ Page({
allGoodsdata: allGoodsdata
})
} else if (options.Day != undefined){//说明从秒杀界面过来的
console.log(4)
that.getdata(options.Type, options.Day, parseInt(options.Time));
} else if (options.goodstype=='0'){
console.log(5)
that.getnoShelfGoods();
}else{
console.log(6)
that.getdata(parseInt(that.data.goodstype));
}
},
... ... @@ -492,7 +515,9 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
wx.reLaunch({
url: '../start/start'
})
},
/**
... ...
<view class='content_item' wx:for='{{allGoodsdata}}' wx:key id='{{item.id}}'>
<block wx:if='{{allGoodsdata.length==0}}'>
<view class='nodata'>暂无数据</view>
</block>
<block wx:else>
<view class='content_item' wx:for='{{allGoodsdata}}' wx:key id='{{item.id}}'>
<view class='item_list'>
<view class='choose_icon_box' data-index='{{index}}' catchtap='setselectstatus'>
<view class='iconfont icon-xuanzhongkuang' wx:if='{{item.selectstatus}}'></view>
... ... @@ -8,7 +11,7 @@
<view class='list_img'>
<view class='item_imgbox' wx:if="{{goodstype=='0'}}">
<image src='../../../images/yixiajia@2x.png'></image>
</view>
</view>
<image src='{{item.thumbnail}}'></image>
</view>
<view class='list_info_box'>
... ... @@ -18,102 +21,99 @@
<text>{{item.color}}</text>
<text>{{item.degree}}</text>
</view>
<view class='price' wx:if='{{item.special_price}}'>降¥{{item.price_poor}}</view>
</view>
<view class='list_label_box'>
<view class='list_label_box'>
<view class='list_label' wx:for='{{item.attribute}}' wx:key>{{item}}</view>
</view>
<view class='list_label_box2' wx:if='{{item.type == 1}}'>
<view class='list_label2' wx:for='{{item.label}}' wx:key>{{item}}</view>
<view class='list_label2' wx:for='{{item.label}}' wx:key>{{item}}</view>
</view>
<view class='info_money'>
<view class='info_money onspace'>
<view>
<text class='money_icon'>¥</text>
<text>{{item.price}}</text>
<text>{{item.special_price?item.special_price:item.price}}</text>
</view>
<view class='original_price' wx:if='{{item.special_price}}'>¥{{item.price}}</view>
</view>
</view>
</view>
</view>
<view class='choose_box' >
<view class='box' catchtap='setallselectstatus'>
<view class='choose_icon_box' >
<view class='iconfont icon-xuanzhongkuang' wx:if="{{allselectstatus}}"></view>
<view class='iconfont icon-fangkuang' wx:else></view>
<view class='choose_box'>
<view class='box' catchtap='setallselectstatus'>
<view class='choose_icon_box'>
<view class='iconfont icon-xuanzhongkuang' wx:if="{{allselectstatus}}"></view>
<view class='iconfont icon-fangkuang' wx:else></view>
</view>
<view class='choose_info'>全选</view>
</view>
<view class='choose_info'>全选</view>
</view>
<view class='total'>共
<text class='total_money'>{{goodslen}}</text> 件商品</view>
</view>
<view class='bottom_box' >
<view class='bottom_btn' bindtap='setshowmold_true'>
<view class='iconfont icon-23'></view>
<view>下架</view>
<view class='total'>共
<text class='total_money'>{{goodslen}}</text> 件商品</view>
</view>
<view class='line'></view>
<view class='bottom_btn' catchtap='setfalse1_to_true'>
<view class='iconfont icon-guanli-copy'></view>
<view>批量至</view>
<view class='bottom_box'>
<view class='bottom_btn' bindtap='setshowmold_true'>
<view class='iconfont icon-23'></view>
<view>下架</view>
</view>
<view class='line'></view>
<view class='bottom_btn' catchtap='setfalse1_to_true'>
<view class='iconfont icon-guanli-copy'></view>
<view>批量至</view>
</view>
</view>
</view>
<view class='batch_mask' wx:if='{{false1}}' bindtap='setfalse1_to_flase'>
<view class='popup_box' wx:if='{{ifshowjj}}' catchtap='voidfun'>
<view class='batck_popup'>
<view class='iconfont icon-cha-copy' catchtap='setifshowjj_flase'></view>
<view>确定从降价处理中转出</view>
<view class='popup_info'>降价处理的商品按照原价转移到其他分类中</view>
<view class='batch_mask' wx:if='{{false1}}' bindtap='setfalse1_to_flase'>
<view class='popup_box' wx:if='{{ifshowjj}}' catchtap='voidfun'>
<view class='batck_popup'>
<view class='iconfont icon-cha-copy' catchtap='setifshowjj_flase'></view>
<view>确定将商品转入降价处理</view>
<view class='popup_info'>商品将按照降价处理</view>
</view>
<view class='popup_btn' catchtap='setifshowjj_flase'>确定</view>
</view>
<view class='popup_btn' catchtap='setifshowjj_flase'>确定</view>
</view>
<view class='popup_box' catchtap='voidfun' wx:else>
<view class='classify_popup'>
<view class='iconfont icon-cha-copy' catchtap='setfalse1_to_flase'></view>
<view class='popup_title'>将所选商品分类至</view>
<view class='popup_label'>
<view class="label {{batchstatus==2?'style':''}}"
catchtap="setbatchstatus" data-batchstatus='2'>
秒杀专场
<text class='iconfont icon-fanhui'></text>
</view>
<view class="label {{goodstype==1?'stylenone':''}} {{batchstatus==1?'style':''}}"
catchtap="{{goodstype == 1 ?'':'setbatchstatus'}}" data-batchstatus='1'>
新品推荐
<text class='iconfont icon-fanhui'></text>
</view>
<view class="label {{goodstype==3?'stylenone':''}} {{batchstatus==3?'style':''}}"
catchtap="{{goodstype == 3? '':'setbatchstatus'}}" data-batchstatus='3'>
降价处理
<text class='iconfont icon-fanhui'></text>
</view>
<view class='popup_time' wx:if='{{batchstatus==2}}' catchtap='gochooseTime'>
<view>秒杀专场时间段</view>
<view class='time_box'>{{day+ ' '+time}}
<text class='iconfont icon-fanhui'></text> </view>
</view>
<view class="popup_input {{ flag?'':'bordernone'}}"
wx:if='{{batchstatus==3}}'>
<text wx:if='{{flag}}'>¥</text>
<view class="input_box " wx:if='{{flag}}'>
<input placeholder='请重新设置该商品的价格' bindinput='setspecial_price'></input>
<view class='popup_box' catchtap='voidfun' wx:else>
<view class='classify_popup'>
<view class='iconfont icon-cha-copy' catchtap='setfalse1_to_flase'></view>
<view class='popup_title'>将所选商品分类至</view>
<view class='popup_label'>
<view class="label {{batchstatus==2?'style':''}}" catchtap="setbatchstatus" data-batchstatus='2'>
秒杀专场
<text class='iconfont icon-fanhui'></text>
</view>
<view class="label {{goodstype==1?'stylenone':''}} {{batchstatus==1?'style':''}}" catchtap="{{goodstype == 1 ?'':'setbatchstatus'}}" data-batchstatus='1'>
新品推荐
<text class='iconfont icon-fanhui'></text>
</view>
<view class="label {{goodstype==3?'stylenone':''}} {{batchstatus==3?'style':''}}" catchtap="{{goodstype == 3? '':'setbatchstatus'}}" data-batchstatus='3'>
降价处理
<text class='iconfont icon-fanhui'></text>
</view>
<view class='popup_time' wx:if='{{batchstatus==2}}' catchtap='gochooseTime'>
<view>秒杀专场时间段</view>
<view class='time_box'>{{day+ ' '+time}}
<text class='iconfont icon-fanhui'></text> </view>
</view>
<view class='popup_hint' wx:else>抱歉,只能选择单个商品</view>
</view>
<view class="popup_input {{ flag?'':'bordernone'}}" wx:if='{{batchstatus==3}}'>
<text wx:if='{{flag}}'>¥</text>
<view class="input_box " wx:if='{{flag}}'>
<input placeholder='请重新设置该商品的价格' bindinput='setspecial_price' type='number'></input>
</view>
<view class='popup_hint' wx:else>抱歉,只能选择单个商品</view>
</view>
</view>
</view>
<view class='popup_btn' catchtap='putin'>确定</view>
</view>
<view class='popup_btn' catchtap='putin'>确定</view>
</view>
</view>
<!-- 关闭弹框 -->
<view class='mold' wx:if='{{showmold}}' bindtap='setshowmold_flase'>
<view class='mold_all' catchtap='voidfun'>
<view class='iconfont icon-cha-copy' catchtap='setshowmold_flase'></view>
<view class='mold_all_txt'>确定将所选中的商品下架吗?</view>
<view class='btn_box'>
<view class='btn_left' catchtap='setshowmold_flase'>取消</view>
<view class='btn_rigth' catchtap='moveDiscount'>确定</view>
<!-- 关闭弹框 -->
<view class='mold' wx:if='{{showmold}}' bindtap='setshowmold_flase'>
<view class='mold_all' catchtap='voidfun'>
<view class='iconfont icon-cha-copy' catchtap='setshowmold_flase'></view>
<view class='mold_all_txt'>确定将所选中的商品下架吗?</view>
<view class='btn_box'>
<view class='btn_left' catchtap='setshowmold_flase'>取消</view>
<view class='btn_rigth' catchtap='moveDiscount'>确定</view>
</view>
</view>
</view>
</view>
</view>
</block>
\ No newline at end of file
... ...
... ... @@ -217,15 +217,18 @@ page {
}
.batck_popup {
width: 100%;
width: 680rpx;
/* width:100%; */
margin: 0 auto;
height: 430rpx;
font-size: 34rpx;
color: #333;
background: rgba(255, 255, 255, 1);
border-radius: 20rpx 20rpx 0rpx 0rpx;
border-radius: 20rpx ;
position: fixed;
bottom: 0;
left: 0;
bottom: 42%;
/* bottom: 0; */
left: 5%;
display: flex;
align-items: center;
justify-content: center;
... ... @@ -247,30 +250,40 @@ page {
}
.popup_btn {
width: 100%;
width: 680rpx;
/* width:100%; */
margin: 0 auto;
height: 87rpx;
font-size: 34rpx;
color: #fff;
background: rgba(15, 113, 205, 1);
position: absolute;
bottom: 0;
left: 0;
bottom: 42%;
/* bottom: 0; */
left: 5%;
display: flex;
align-items: center;
justify-content: center;
border-bottom-right-radius: 20rpx;
border-bottom-left-radius: 20rpx;
}
.classify_popup {
width: 100%;
width: 680rpx;
/* width: 100%; */
height: 430rpx;
font-size: 34rpx;
color: #333;
background: rgba(255, 255, 255, 1);
border-radius: 20rpx 20rpx 0rpx 0rpx;
border-radius: 20rpx ;
position: fixed;
bottom: 0;
left: 0;
padding: 0 40rpx;
bottom: 42%;
/* bottom: 0; */
left: 5%;
padding: 0 30rpx;
overflow: hidden;
}
.popup_title {
... ... @@ -294,7 +307,7 @@ page {
}
.label {
width: 208rpx;
width: 200rpx;
height: 77rpx;
font-size: 30rpx;
color: #333;
... ... @@ -319,15 +332,18 @@ page {
.popup_time {
width: 100%;
font-size: 30rpx;
font-size: 26rpx;
color: #333;
display: flex;
align-items: center;
justify-content: space-between;
padding:20rpx 0;
}
.time_box {
color: #0f71cd;
display: flex;
align-items: center;
}
.popup_input {
... ... @@ -341,7 +357,7 @@ page {
}
.input_box {
font-size: 32rpx;
font-size: 30rpx;
margin-left: 22rpx;
}
... ... @@ -436,4 +452,20 @@ bottom:20rpx;
font-size:32rpx;
background-color:#1A73CA;
border-radius: 5rpx;
}
.popup_box{
display: flex;
justify-content: center;
align-items: center;
width:100%;
height: 100%;
}
.original_price{
font-size: 24rpx;
color: #999999;
margin-left: 24rpx;
text-decoration-line: line-through;
}
.onspace{
justify-content: flex-start;
}
\ No newline at end of file
... ...
... ... @@ -12,12 +12,10 @@ Page({
selectitem:"",//选择时间段
selectitem_id:'',//选择时间段ID
date:[]//当天时间
},
//获取当天数据
getcurrentday(){
let date = app.dateLater( 0);
let date = app.dateLater(0);
this.setData({
date:date
})
... ... @@ -146,7 +144,9 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
wx.reLaunch({
url: '../start/start'
})
},
/**
... ...
... ... @@ -2,10 +2,14 @@
page {
background: #f5f6fa;
padding:220rpx 0 0 0;
}
.banner_box {
padding: 30rpx 20rpx;
position: fixed;
top:0;
left:0;
}
.banner_btn_box {
... ...
... ... @@ -10,10 +10,11 @@ Page({
goodstype:1,//1新品推荐,2秒杀专区,3降价处理
goodsManagementstatus:1,//1表示出售中,2已授完, 3以下架
data: '',//当前调用typeNum函数data值
selling:[0,0,0,0,0,0,0],//出售中调用接口后返货的数据,对应界面顺序
selling:['','','','','','',''],//出售中调用接口后返货的数据,对应界面顺序
i: 0, //数组接口出售中调用接口后返货的数据
postdata:[
{ Type: 1, Day: '', Time: '' }//新品推荐数据
],
TimeIntervaldata:[],//秒杀时间段
noShelfdata:'',//已下架商品data
... ... @@ -21,7 +22,7 @@ Page({
},
setgoodsManagementstatus(e){
let that=this;
console.log(e)
that.setData({
goodsManagementstatus: e.currentTarget.dataset.status
})
... ... @@ -78,7 +79,7 @@ Page({
}).catch((errMsg) => {
console.log(errMsg);
})
}
}
},
//已售完加载调用
getsoldOutGoods(){
... ... @@ -112,8 +113,7 @@ Page({
}
that.setData({
noShelfdata: noShelfdata
})
console.log(that.data.noShelfdata)
})
}
}).catch((errMsg)=>{
console.log(errMsg)
... ... @@ -152,14 +152,13 @@ Page({
fail: function(res) {},
complete: function(res) {},
})
},
// 调用秒杀时间段的接口
getTimeInterval(){
let that=this;
let url ='goods/getTimeInterval';
app.post(url,{}).then((res)=>{
console.log(res);
if(res.data.code==200){
let TimeIntervaldata=[];
let postdata = that.data.postdata;
... ... @@ -191,11 +190,13 @@ Page({
*/
onLoad: function (options) {
let that=this;
wx.showNavigationBarLoading();
this.getTimeInterval();
//type=1是新品推荐。type=3是降价专区。type=2是秒杀专区,1,3不用输入时间。2需要输入时间
this.getnoShelfGoods();
this.getsoldOutGoods();
wx.hideNavigationBarLoading()
},
... ... @@ -206,16 +207,17 @@ Page({
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
let that = this;
this.getTimeInterval();
//type=1是新品推荐。type=3是降价专区。type=2是秒杀专区,1,3不用输入时间。2需要输入时间
this.getnoShelfGoods();
this.getsoldOutGoods();
},
... ... @@ -230,7 +232,9 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
wx.reLaunch({
url: '../start/start'
})
},
/**
... ...
... ... @@ -5,7 +5,7 @@
<view class="banner_btn {{ goodsManagementstatus==2?'active':''}}" data-status='2' bindtap='setgoodsManagementstatus'>已售完</view>
<view class="banner_btn {{ goodsManagementstatus==3?'active':''}}" data-status='3' bindtap='setgoodsManagementstatus'>已下架</view>
</view>
</view>
</view>
<!--内容 出售中 -->
<block wx:if='{{goodsManagementstatus==1}}'>
<view class='content_item'>
... ... @@ -51,7 +51,8 @@
</view>
</view>
<view class='list_label_box'>
<view class='list_label' wx:for='{{item.attribute}}' wx:key>{{item}}</view>
<view class='list_label' wx:for='{{item.attribute}}' wx:key
>{{item}}</view>
</view>
<view class='list_label_box2' wx:if='{{item.type == 1}}'>
<view class='list_label2' wx:for='{{item.label}}' wx:key>{{item}}</view>
... ... @@ -96,10 +97,10 @@
</view>
</view>
<view class='list_label_box'>
<view class='list_label' wx:for='{{[item.attribute.brandname,item.attribute.memory,item.attribute.modelname,item.attribute.version]}}' wx:key>{{item}}</view>
<view class='list_label' wx:for='{{[item.attribute.brandname,item.attribute.memory,item.attribute.modelname,item.attribute.version]}}' wx:key >{{item}}</view>
</view>
<view class='list_label_box2' wx:if='{{item.type==1}}'>
<view class='list_label2' wx:for='{{[item.label.is_original,item.label.screen]}}' wx:key>{{item}}</view>
<view class='list_label2' wx:for='{{[item.label.is_original,item.label.screen]}}' wx:key >{{item}}</view>
</view>
<view class='info_money'>
<view>
... ...
... ... @@ -2,12 +2,18 @@
page {
background: #f5f6fa;
padding:150rpx 0 100rpx 0;
}
.banner_box {
padding: 30rpx 20rpx;
position: fixed;
left:0;
top:0;
width:100%;
background: #f5f6fa;
z-index: 2;
}
.banner_btn_box {
height: 80rpx;
border-radius: 5rpx;
... ...
... ... @@ -68,7 +68,9 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
wx.reLaunch({
url: '../start/start'
})
},
/**
... ...
// pages/backStage/orderDetail/orderDetail.js
const app=getApp();
var mobileReg = /^1(3[0-9]|4[57]|5[0-35-9]|7[0135678]|8[0-9])\d{8}$/;
//顺丰速运
var SF = /^[0-9]{9,18}$/;
//中通快递
// var ZT = /^((618|680|828|571|518)[0-9]{9})$|^(2008[0-9]{8})$|^((00|10)[0-9]{10})$/;
var ZT = /^[0-9]{9,18}$/;
//其他快递
let reg = /^[0-9]{9,18}$/;
const util=require('../../../utils/util.js')
Page({
/**
* 页面的初始数据
*/
data: {
id: '',
state: '',//状态订单数据(0未支付,待付款,1已支付,待发货,2待收货,已发货,3已完成)
inputdisflase:false,//是否禁用input输入框
orderdata: [],//delivery_mode 1表示到店提货,2表示货到付款
showtel:false,
tel: '',
... ... @@ -24,29 +33,64 @@ Page({
orderdata.location = this.data.location;
orderdata.name=this.data.name;
orderdata.phone_num=this.data.tel;
this.setData({
orderdata:orderdata
})
wx.showToast({
title: '修改成功',
icon: 'none',
duration: 2000,
})
setTimeout(function(){
that.setData({
showmain:true
if (orderdata.location==''){
wx.showToast({
title: '请填写收货地址',
icon: 'none',
duration: 2000,
})
} else if (orderdata.name==''){
wx.showToast({
title: '请填写姓名',
icon: 'none',
duration: 2000,
})
} else if (orderdata.phone_num==''){
wx.showToast({
title: '请填写电话号码',
icon: 'none',
duration: 2000,
})
} else if (!mobileReg.test(orderdata.phone_num)){
wx.showToast({
title: '请正确填写号码',
icon: 'none',
duration: 2000,
})
}else{
this.setData({
orderdata: orderdata
})
wx.showToast({
title: '修改成功',
icon: 'none',
duration: 2000,
})
},2000)
setTimeout(function () {
that.setData({
showmain: true
})
}, 2000)
}
},
setshowmain_flose(){
let that=this;
that.setData({
showmain:false
})
wx.setNavigationBarTitle({
title: '编辑收货信息'
})
let state = that.data.state;
if (state==2 || state==3){
}else{
that.setData({
showmain: false
})
wx.setNavigationBarTitle({
title: '编辑收货信息'
})
}
},
setshowmain_true(){
let that=this;
... ... @@ -67,6 +111,14 @@ Page({
showtel: false
})
},
setnote(e){
let that=this;
let orderdata = that.data.orderdata;
orderdata.note = e.detail.value;
that.setData({
orderdata:orderdata
})
},
voidfun(){
},
tel(){
... ... @@ -79,7 +131,7 @@ Page({
})
},
setlocation(e){
console.log(e.detail.value)
let orderdata = this.data.orderdata;
orderdata.location = e.detail.value
this.setData({
... ... @@ -113,80 +165,157 @@ Page({
if(res.data.code==200){
let orderdata = res.data.data;
orderdata.create_times = util.formatTime(orderdata.create_time,'Y-M-D'),
orderdata.delete_times = util.formatTime(orderdata.delete_time, 'Y-M-D')
orderdata.pay_times = util.formatTime(orderdata.pay_time,'Y-M-D')
orderdata.delete_times = util.formatTime(orderdata.delete_time, 'Y-M-D'),
orderdata.courier = (orderdata.courier == null) ? '顺丰' : orderdata.courier,
orderdata.courier_number = parseInt(orderdata.courier_number)? orderdata.courier_number:' '
that.setData({
orderdata: orderdata,
tel: orderdata.phone_num
tel: orderdata.phone_num,
location: orderdata.location,
name: orderdata.name
})
}
}).catch((errMsg)=>{
console.log(errMsg)
})
})
},
//发货(还没有做判断)
sendgoods(){
let that=this;
let orderdata = that.data.orderdata;
let url ='ordermanage/orderDeliver';
let params={
order_id: orderdata.id,
name:orderdata.name,
phone_num: orderdata.phone_num,
address: orderdata.address,
location: orderdata.location,
courier: orderdata.courier,
courier_number: orderdata.courier_number
let testf=false;
if (orderdata.delivery_mode=='2'){
if (orderdata.courier_number == null || orderdata.courier_number == '') {
wx.showToast({
title: '请填写快递单号',
icon: 'none',
duration: 2000,
})
} else if (orderdata.courier == '顺丰') {
if (!SF.test(parseInt(orderdata.courier_number))) {
wx.showToast({
title: '请正确填写顺丰单号',
icon: 'none',
duration: 2000,
})
} else {
testf = true;
}
} else if (orderdata.courier == '中通') {
if (!ZT.test(parseInt(orderdata.courier_number))) {
wx.showToast({
title: '请正确填写中通单号',
icon: 'none',
duration: 2000,
})
} else {
testf = true;
}
} else if (orderdata.courier == '其他') {
if (!reg.test(parseInt(orderdata.courier_number))) {
wx.showToast({
title: '请正确填写快递单号',
icon: 'none',
duration: 2000,
})
} else {
console.log(2)
testf = true;
}
}
}else{
testf=true;
}
app.post(url, params).then((res)=>{
console.log(res)
wx.showToast({
title: '设置成功',
icon: 'none',
duration: 2000,
if (testf){
let url = 'ordermanage/orderDeliver';
let params = {
order_id: orderdata.id,
name: orderdata.name,
phone_num: orderdata.phone_num,
address: orderdata.address,
location: orderdata.location,
courier: orderdata.courier,
delivery_mode: orderdata.delivery_mode,
courier_number: orderdata.courier_number
}
app.post(url, params).then((res) => {
if (res.data.code == 200) {
wx.showToast({
title: '操作成功',
icon: 'success',
duration: 2000,
})
setTimeout(function () {
wx.navigateBack({
delta: 1,
})
}, 2000)
}
}).catch((errMsg) => {
console.log(errMsg)
})
}).catch((errMsg)=>{
console.log(errMsg)
})
}
},
//设置顺丰快递
setexpresssf(){
let that=this;
let orderdata = that.data.orderdata;
orderdata.courier ='顺丰'
this.setData({
orderdata: orderdata
})
let state = that.data.state;//订单数据(0未支付,待付款,1已支付,待发货,2待收货,已发货,3已完成)
if (state == '2' || state == '3' ){
}else{
let orderdata = that.data.orderdata;
orderdata.courier = '顺丰'
this.setData({
orderdata: orderdata
})
}
},
//设置快递单号
setcourier_number(e){
let that=this;
let orderdata = that.data.orderdata;
orderdata.courier_number =e.detail.value;
this.setData({
orderdata: orderdata
})
let state = that.data.state;//订单数据(0未支付,待付款,1已支付,待发货,2待收货,已发货,3已完成)
if (state == '2' || state == '3') {
} else {
let orderdata = that.data.orderdata;
orderdata.courier_number = e.detail.value;
this.setData({
orderdata: orderdata
})
}
},
//设置中通快递
setexpresszt() {
let that=this;
let orderdata = that.data.orderdata;
orderdata.courier = '中通'
this.setData({
orderdata: orderdata,
courier:'中通'
})
let state = that.data.state;//订单数据(0未支付,待付款,1已支付,待发货,2待收货,已发货,3已完成)
if (state == '2' || state == '3') {
} else {
let orderdata = that.data.orderdata;
orderdata.courier = '中通'
this.setData({
orderdata: orderdata,
courier: '中通'
})
}
},
//设置其他快递
setexpressqt() {
let that=this;
let orderdata = that.data.orderdata;
orderdata.courier = '其他'
this.setData({
orderdata: orderdata,
courier:'其他'
})
let state = that.data.state;//订单数据(0未支付,待付款,1已支付,待发货,2待收货,已发货,3已完成)
if (state == '2' || state == '3') {
} else {
let orderdata = that.data.orderdata;
orderdata.courier = '其他'
this.setData({
orderdata: orderdata,
courier: '其他'
})
}
},
/**
* 生命周期函数--监听页面加载
... ... @@ -194,9 +323,16 @@ Page({
onLoad: function (options) {
let that=this;
console.log(options)
let inputdisflase=''
if (options.state == 2 || options.state == 3) {//2待收货,已发货,3已完成
inputdisflase=true//禁用input输入框
}
that.setData({
id:options.id
id:options.id,
state: options.state,
inputdisflase: inputdisflase
})
that.getdata();
},
... ... @@ -225,7 +361,9 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
wx.reLaunch({
url: '../start/start'
})
},
/**
... ...
... ... @@ -22,11 +22,11 @@
<view class='item_list'>
<view class='list_title'>备注</view>
<view class='list_input'>
<input value='{{orderdata.note}}'></input>
<input value='{{orderdata.note}}' bindinput='setnote' disabled='{{inputdisflase}}'></input>
</view>
</view>
<view class='item_list'>
<view class='list_title'>{{orderdata.delivery_mode==2?'到货支付':'到店自提'}}</view>
<view class='list_title'>{{orderdata.delivery_mode==2?'快递发货(邮费到付)':'到店自提'}}</view>
</view>
<view class="item_list" wx:if='{{orderdata.delivery_mode==2}}'>
<view class='way_box'>
... ... @@ -51,7 +51,8 @@
<view class='item_list' wx:if='{{orderdata.delivery_mode==2}}'>
<view class='list_title'>快递单号</view>
<view class='list_input'>
<input type='number' placeholder='请输入快递单号' bindinput='setcourier_number'></input>
<input placeholder='请输入快递单号'
value="{{orderdata.courier_number}}" bindinput='setcourier_number' disabled='{{inputdisflase}}'></input>
</view>
</view>
<view class='item_list' wx:for='{{orderdata.goods_detail}}' wx:key>
... ... @@ -103,13 +104,13 @@
</view>
<view class='money_box info' wx:if='{{orderdata.delivery_mode==2}}'>
<view class='list_title'>用户付款时间</view>
<view>{{ orderdata.pay_times}}</view>
<view>{{ orderdata.pay_time}}</view>
</view>
</view>
</view>
<view class='bottom_btn'>
<view class='cancel_btn' bindtap='cancel_order' bindtap='setshowtel_true'>联系买 家</view>
<view class='charge' bindtap='sendgoods' wx:if='{{orderdata.delivery_mode==2}}'>发货</view>
<view class='cancel_btn' bindtap='cancel_order' bindtap='setshowtel_true'>联系买家</view>
<view class='charge' bindtap='sendgoods' wx:if='{{orderdata.state==1}}'>{{orderdata.delivery_mode==1?'出库':'发货'}}</view>
</view>
<view class='mask_box' wx:if='{{showtel}}' bindtap='setshowtel_false'>
<view class='popup_box' catchtap='voidfun'>
... ... @@ -125,19 +126,19 @@
<view class='list_title'>详细地址</view>
<view class='list_picker'>
<input placeholder='请填写详细地址' value='{{orderdata.location}}'
bindinput='setlocation' ></input>
bindinput='setlocation' disabled='{{inputdisflase}}' ></input>
</view>
</view>
<view class='item_lists'>
<view class='list_title' >收货人</view>
<view class='list_picker'>
<input placeholder='请填写收货人' value='{{orderdata.name}}' bindinput='setname'></input>
<input placeholder='请填写收货人' value='{{orderdata.name}}' bindinput='setname' disabled='{{inputdisflase}}'></input>
</view>
</view>
<view class='item_lists'>
<view class='list_title'>联系电话</view>
<view class='list_picker'>
<input placeholder='请填写联系电话' value='{{orderdata.phone_num}}' bindinput='settelinput'></input>
<input placeholder='请填写联系电话' value='{{orderdata.phone_num}}' bindinput='settelinput' type='number' disabled='{{inputdisflase}}'></input>
</view>
</view>
... ...
... ... @@ -3,16 +3,16 @@
const app=getApp()
const util = require('../../../utils/util.js')
Page({
/**
* 页面的初始数据
*/
data: {
startdate: '年/月/日',
enddate:'年/月/日',
orderall: [],//订单数据(0未支付,代收款,1已支付,待发货,2待收货,已发货,3已完成)
orderall: [],//订单数据(0未支付,待付款,1已支付,待发货,2待收货,已发货,3已完成)
state:'',//订单状态
order_no:''//订单编号
order_no:'',//关键词
newdate:''
},
//选择时间
chargePickerstart(e) {
... ... @@ -36,7 +36,7 @@ Page({
console.log(e)
let id=e.currentTarget.id;
wx.navigateTo({
url: '../orderDetail/orderDetail?id='+id,
url: '../orderDetail/orderDetail?id='+id+'&state='+e.currentTarget.dataset.state,
success: function(res) {},
fail: function(res) {},
complete: function(res) {},
... ... @@ -50,9 +50,8 @@ Page({
start_time: that.data.startdate,
end_time: that.data.enddate,
state: that.data.state,
order_no: that.data.order_no
key: that.data.order_no
}).then((res)=>{
console.log(res)
if(res.data.code==200){
let orderall = res.data.data
for (let obj of orderall){
... ... @@ -61,18 +60,15 @@ Page({
}
that.setData({
orderall: orderall,
end_time:'年/月/日',
startdate: '年/月/日',
order_no:''
})
})
}
}).catch((errMsg)=>{
console.log(errMsg)
})
},
swichNav(e){
console.log(e)
this.setData({
state: e.currentTarget.dataset.current
})
... ... @@ -84,7 +80,11 @@ Page({
onLoad: function(options) {
let that=this;
that.getdata();
let date = new Date();
let newdate = date.getFullYear() + '-' + ((date.getMonth() + 1) < 10 ? ("0" + (date.getMonth() + 1)) : date.getMonth() + 1) + '-' + (date.getDate() < 10 ? ("0" + date.getDate()) : date.getDate());
this.setData({
newdate: newdate
})
},
/**
... ... @@ -98,7 +98,13 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function() {
let that = this;
that.getdata();
let date=new Date();
let newdate = date.getFullYear() + '-' + ((date.getMonth() + 1) < 10 ? ("0" + (date.getMonth() + 1)) : date.getMonth() + 1) + '-' + (date.getDate() < 10 ? ("0" + date.getDate()) : date.getDate());
this.setData({
newdate: newdate
})
},
/**
... ... @@ -112,7 +118,9 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
wx.reLaunch({
url: '../start/start'
})
},
/**
... ...
... ... @@ -10,7 +10,7 @@
</view>
<view>至</view>
<view class='banner_picker'>
<picker mode='date' value='{{enddate}}' start='{{startdate}}' bindchange='chargePickerend'>
<picker mode='date' value='{{enddate}}' start='{{startdate}}' bindchange='chargePickerend' end='{{newdate}}'>
<view>{{enddate}}</view>
</picker>
</view>
... ... @@ -22,7 +22,7 @@
<image src='/images/serach.png'></image>
</view>
<view class='search_input'>
<input placeholder='搜索订单编号' value='{{order_no}}' bindinput='setorder_no'></input>
<input placeholder='输入会员名称或手机号' value='{{order_no}}' bindinput='setorder_no'></input>
</view>
<view class='search_txt' bindtap='getdata'>搜索</view>
</view>
... ... @@ -39,8 +39,7 @@
<view class='nodata'>暂无数据</view>
</block>
<block wx:else>
<view class='content_item' wx:for='{{orderall}}' wx:key wx:for-item='items' wx:for-index='indexs' id='{{items.id}}' bindtap='goorderdetail'>
<view class='content_item' wx:for='{{orderall}}' wx:key wx:for-item='items' wx:for-index='indexs' id='{{items.id}}' data-state='{{items.state}}' bindtap='goorderdetail'>
<view class='item_list'>
<view class='list_img'>
<image src='{{items.goods_detail[0].thumbnail}}'></image>
... ... @@ -53,23 +52,23 @@
</view>
<view class='content_info time'>
<text>{{items.delete_times}}</text>
<text>{{items.delivery_mode==1?'到店自提':'货到付款'}}</text>
<text>{{items.delivery_mode==1?'到店自提':'快递发货(邮费到付)'}}</text>
<block wx:if="{{items.state==0}}">
<text>待收款</text>
</block>
<block wx:elif="{{items.state==1}}">
<text>已支付</text>
<text>已支付{{items.delivery_mode=='1'?'(代取)':''}}</text>
</block>
<block wx:elif="{{items.state==2}}">
<text>已发货</text>
<text>{{items.delivery_mode=='1'?'已完成':'已发货'}}</text>
</block>
<block wx:else>
<block wx:elif='{{items.state==3}}'>
<text>已完成</text>
</block>
</view>
</view>
</view>
<view class='order_btn' wx:if='{{(items.delivery_mode==2)&&(items.state==0 || items.state==1)}}'>
<view class='order_btn' wx:if='{{(items.delivery_mode==2)&&(items.state==1)}}'>
<view class='charge'>发货</view>
</view>
</view>
... ...
... ... @@ -36,7 +36,7 @@ page {
}
.banner_picker picker {
width: 100%;
width: 300rpx;
height: 100%;
}
... ...
// pages/backStage/chooseTime/chooseTime.js
const app = getApp();
var formatTime_date = require('../../../utils/util.js');
Page({
/**
* 页面的初始数据
... ... @@ -21,7 +22,7 @@ Page({
that.setData({
currentthreedaydate: currentthreedaydate
})
that.getTimeInterval(); //获得数据
that.getTimeInterval(); //获得秒杀时间段
},
//get秒杀时间段
getTimeInterval() {
... ... @@ -51,11 +52,11 @@ Page({
},
getdata() {
let that = this;
that.setData({
selling: []
})
let selling = [];
let sellings = [];
let postdata = this.data.postdata;
for (let i = 0; i < postdata.length; i++) {
let that = this;
... ... @@ -67,10 +68,11 @@ Page({
}
app.post(url, params).then((res) => {
if (res.data.code == 200) {
selling.push(res.data.data);
selling[i] = res.data.data;
that.setData({
selling: selling
})
}
}).catch((errMsg) => {
console.log(errMsg);
... ... @@ -85,6 +87,7 @@ Page({
that.setData({
top_active: top_active
})
//设置接口参数,并调用函数
for (let i in postdata) {
postdata[i].day = day;
... ... @@ -97,17 +100,19 @@ Page({
gobatchManagement(e) {
let that = this;
let Time = parseInt(e.currentTarget.id);
let Type = '';
let Day = '';
let postdata = that.data.postdata;
for (let obj of postdata) {
console.log(obj)
if (Time == obj.Time) {
Type = obj.Type;
Day = obj.day;
}
}
console.log(e)
wx.setStorageSync('Seckilltime_id', e.currentTarget.id);
wx.setStorageSync('Seckillday', Day);
wx.navigateTo({
url: '../batchManagement/batchManagement?Day=' + Day + '&Time=' + Time + '&Type=' + Type,
success: function(res) {},
... ... @@ -128,7 +133,9 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
wx.showNavigationBarLoading();
this.getcurrentthreeday();
wx.hideNavigationBarLoading();
},
/**
* 生命周期函数--监听页面初次渲染完成
... ... @@ -155,7 +162,9 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
wx.reLaunch({
url: '../start/start'
})
},
/**
... ...
... ... @@ -33,7 +33,7 @@
</view>
</view>
<view class='bottom_box' >
<view class='bottom_box' bindtap='goaddgoods'>
<view class='bottom_btn add_goods seckillbtn'>
<view class='iconfont icon-jia'></view>
<view>添加商品</view>
... ...
... ... @@ -7,21 +7,21 @@ Page({
*/
data: {
userdata:[],
key:'key'
key:'',
sortId: 1//1倒叙,2正序,默认是1
},
getdata(key = '', sortId = '') {//1倒叙,2正序,默认是1
getdata(key = '', sortId = 1) {//1倒叙,2正序,默认是1
let that=this;
let url ='Usersmanage/index';
app.post(url,{
key: key,
sortId:sortId
}).then((res)=>{
console.log(res)
console.log(res.data.code)
if(res.data.code==200){
that.setData({
userdata:res.data.data,
key:''
})
}
}).catch((errMsg)=>{
... ... @@ -34,13 +34,19 @@ Page({
key:e.detail.value
})
},
setsortId1() {////1倒叙,2正序,默认是1
let that=this;
that.getdata(that.data.key, 1)
},
setsortId2() {////1倒叙,2正序,默认是1
setsortId() {////1倒叙,2正序,默认是1
let that = this;
that.getdata(that.data.key, 2)
let sortId = that.data.sortId;
if (sortId==1){
sortId=2;
}else{
sortId=1
}
that.getdata(that.data.key, sortId)
that.setData({
sortId: sortId
})
},
search(){
let that=this;
... ... @@ -105,7 +111,9 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
wx.reLaunch({
url: '../start/start'
})
},
/**
... ...
... ... @@ -14,13 +14,13 @@
<view class='content_item'>
<view class='list_title_box'>
<view>会员列表</view>
<view class='sort_box'>
<view class='sort_box' bindtap='setsortId'>
<view class='sub_title'>注册时间</view>
<view>
<view class='sort_img' bindtap='setsortId1'>
<view class='sort_img'>
<image src='/images/up.png'></image>
</view>
<view class='sort_img' bindtap='setsortId2'>
<view class='sort_img'>
<image src='/images/down.png'></image>
</view>
</view>
... ...
... ... @@ -50,7 +50,9 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
wx.reLaunch({
url: '../start/start'
})
},
/**
... ...
... ... @@ -73,7 +73,9 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
wx.reLaunch({
url: '../start/start'
})
},
/**
... ...
// pages/classify/androidList/androidList.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
... ... @@ -9,74 +8,95 @@ Page({
moudel: false,
goodsdetaillist: [],
goodtype: [],
goodsmode:[],//机型
degreelist: [],
pricelist:[],
sid: '', //系统id
bid: '', //传参的品牌id
tid: '', //选中品牌的id
mid: '', //机型id
did: '', //新旧程度id
state1: '',
state2: '',
state3: '',
price:'',//价格区间
curr_state1id: '',//品牌id
curr_state2id: '',//机型id
curr_state3content: '',//价格区间
curr_state4id: '',//新旧程度id
},
//点击tab改变标题样式
chargeStyle1(e) {
console.log(e)
var state1 = e.currentTarget.dataset.index
var state2 = e.currentTarget.dataset.index
var state3 = e.currentTarget.dataset.index
var id = e.currentTarget.dataset.id
this.setData({
state1: state1,
tid: id
let that=this;
var curr_state1id = e.currentTarget.dataset.id//
var id = e.currentTarget.dataset.id;
if (e.currentTarget.dataset.id==''){
that.getallmode();//获取全部机型
}else{
that.goodmode(id);//获取指定品牌机型
}
console.log('id:' + id);
that.setData({
curr_state1id: curr_state1id,
tid: id,
mid: '', //机型id
did: '', //新旧程度id
price: '',//价格区间
})
},
//点击tab改变标题样式
chargeStyle2(e) {
console.log(e)
var state1 = e.currentTarget.dataset.index
var state2 = e.currentTarget.dataset.index
var state3 = e.currentTarget.dataset.index
var curr_state2id = e.currentTarget.dataset.id
var id = e.currentTarget.dataset.id
this.setData({
state2: state2,
mid: id
curr_state2id: curr_state2id,
mid: id,
// tid: '', //选中品牌的id
did: '', //新旧程度id
price: '',//价格区间
})
},
//点击tab改变标题样式
chargeStyle3(e) {
console.log(e)
var state1 = e.currentTarget.dataset.index
var state2 = e.currentTarget.dataset.index
var state3 = e.currentTarget.dataset.index
let price = e.currentTarget.dataset.price;
this.setData({
curr_state3content: price,
price: price,
// tid: '', //选中品牌的id
// mid: '', //机型id
did: '', //新旧程度id
})
},
//点击tab改变标题样式
chargeStyle4(e) {
var curr_state4id = e.currentTarget.dataset.id
var id = e.currentTarget.dataset.id
this.setData({
state3: state3,
did: id
curr_state4id: curr_state4id,
did: id,
// tid: '', //选中品牌的id
// mid: '', //机型id
//price: '',//价格区间
})
},
//隐藏弹窗
hideMask() {
this.setData({
moudel: false,
moudel1: false,
moudel2: false,
moudel: false,//品牌
moudel1: false,//机型
moudel2: false,//价格
moudel3: false,//新旧程度
})
},
// 品牌
showMask(e) {
console.log(e)
this.setData({
moudel: true,
moudel1: false,
moudel2: false,
moudel3: false,//新旧程度
})
},
... ... @@ -86,50 +106,133 @@ Page({
moudel: false,
moudel1: true,
moudel2: false,
moudel3: false,//新旧程度
})
},
// 新旧程度
showMask2(e) {
this.setData({
moudel: false,
moudel1: false,
moudel2: true,
moudel3: false,
})
},
//专场详情
// goodType(id) {
// let url = 'goods/getTypeById'
// let params = {
// parentID: id
// }
// app.post(url, params).then((res) => {
// if (res.data.code == 200) {
// this.setData({
// goodsdetaillist: res.data.data
// })
// }
// console.log(res.data.data)
// })
// },
// 新旧程度
showMask3(e) {
this.setData({
moudel: false,
moudel1: false,
moudel2: false,
moudel3: true,
})
},
//获取机型id有值的情况
goodmode(id) {
let url = 'goods/getTypeById'
let params = {
parentID: id
}
app.post(url, params).then((res) => {
if (res.data.code == 200) {
let goodsmode=[];
let tem = {
id: '',
name: "全部"
};
goodsmode.push(tem)
for (let obj of res.data.data){
goodsmode.push(obj)
}
this.setData({
goodsmode: goodsmode
})
}
console.log(res.data.data)
})
},
//全部获取机型
getallmode(){
let that=this;
let url ='goods/getGoodsModel';
let params={
system: that.data.sid
}
app.post(url, params).then((res)=>{
if(res.data.code==200){
let goodsmode = [];
let tem = {
id: '',
name: "全部"
};
goodsmode.push(tem)
for (let obj of res.data.data) {
goodsmode.push(obj)
}
this.setData({
goodsmode: goodsmode
})
}
}).catch((errMsg)=>{
console.log(errMsg)
})
},
//得到品牌类型
goodType1(sid) {
let url = 'goods/getTypeById'
let params = {
parentID: sid
}
app.post(url, params).then((res) => {
if (res.data.code == 200) {
let brandlist = [];
let tem = {
id: '',
name: '全部'
};
brandlist.push(tem);
for (let obj of res.data.data){
brandlist.push(obj)
}
this.setData({
brandlist: res.data.data
brandlist: brandlist
})
}
console.log(this.data.brandlist)
})
},
//得到价格区间
getprice(){
let that=this;
let url ='goods/screenPrice';
app.post(url,{}).then((res)=>{
if(res.data.code==200){
let pricelist = [];
let tem={
id:'',
price:'全部'
}
pricelist.push(tem)
for (let obj of res.data.data){
pricelist.push(obj)
}
that.setData({
pricelist: pricelist
})
}else{
that.setData({
pricelist:[]
})
}
}).catch((errMsg)=>{
console.log(errMsg)
})
},
//获取新旧程度
getDegree() {
... ... @@ -137,27 +240,37 @@ Page({
let params = {}
app.post(url, params).then((res) => {
if (res.data.code == 200) {
let degreelist = [];
let tem={
id:'',
degree:'全部'
};
degreelist.push(tem);
for (let obj of res.data.data){
degreelist.push(obj)
}
this.setData({
degreelist: res.data.data
degreelist: degreelist
})
}
})
},
//根据类型选择商品
goodScreening() {
let that=this;
let url = 'goods/goodScreening'
let params = {
system: this.data.sid,
brand: this.data.tid, //选中品牌的id
model: this.data.mid, //机型id
// price: this.data.state,
price: (this.data.price == '全部') ? '' : this.data.price,//价格区间
degree: this.data.did, //新旧程度id
}
app.post(url, params).then((res) => {
console.log(res)
if (res.data.code == 200) {
this.setData({
that.setData({
goodsdetaillist: res.data.data.datalist
})
} else if (res.data.code == 302) {
... ... @@ -165,34 +278,53 @@ Page({
title: '商品不存在',
icon: 'none',
duration: 2000,
success:function(){
that.setData({
goodsdetaillist:[]
})
}
})
}
})
},
//商品详情
productDetail(e) {
console.log(e)
console.log(e.currentTarget.dataset.discount)
var goods_id = e.currentTarget.dataset.id
var discount = e.currentTarget.dataset.discount ? 1 : 0
wx.navigateTo({
url: '../../index/productDetail/productDetail?goods_id=' + goods_id + '&discount=' + discount,
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
console.log(options)
this.setData({
sid: options.sid,
bid: options.id
sid: options.sid,//系统ID
tid: options.id,//品牌
curr_state1id: options.id //品牌
})
// this.goodType(options.id) //专场详情
this.goodType1(options.sid) //得到品牌类型
if (options.id){
this.goodmode(options.id)//获取机型需要id
}else{
this.getallmode()//获取全部机型
}
this.getDegree() //获取新旧程度
this.goodScreening() //显示筛选列表
this.getprice();//得到价格区间
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
... ... @@ -211,7 +343,9 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
wx.reLaunch({
url: '../start/start'
})
},
/**
... ...
... ... @@ -13,13 +13,13 @@
<image src="/images/sort.png"></image>
</view>
</view>
<view class='banner_btn'>
<view class="banner_btn {{currentTab==1 ? 'on' : ''}}" data-current='2' bindtap='showMask2'>
<text>价格</text>
<view class='banner_img'>
<image src="/images/sort.png"></image>
</view>
</view>
<view class="banner_btn{{currentTab==3 ? 'on' : ''}}" data-current='3' bindtap='showMask2'>
<view class="banner_btn{{currentTab==3 ? 'on' : ''}}" data-current='3' bindtap='showMask3'>
<text>新旧程度</text>
<view class='banner_img'>
<image src="/images/sort.png"></image>
... ... @@ -30,7 +30,7 @@
<view class='tab_mask_box' wx:if='{{moudel}}' bindtap='hideMask'>
<view class='tab_content_box' >
<view class='tab_content_detail'>
<view class="tab_content {{state1==index?'active':''}}" wx:for='{{brandlist}}' wx:key='' data-index='{{index}}'
<view class="tab_content {{curr_state1id==item.id?'active':''}}" wx:for='{{brandlist}}' wx:key='' data-index='{{index}}'
data-id='{{item.id}}' catchtap='chargeStyle1' >
<view>{{item.name}}</view>
</view>
... ... @@ -42,54 +42,69 @@
<view class='tab_mask_box' wx:if='{{moudel1}}' bindtap='hideMask'>
<view class='tab_content_box' >
<view class='tab_content_detail'>
<view class="tab_content {{state2==index?'active':''}}" wx:for='{{goodsdetaillist}}' wx:key='' data-index='{{index}}' data-id='{{item.id}}' catchtap='chargeStyle2' >
<view class="tab_content {{curr_state2id==item.id?'active':''}}" wx:for='{{goodsmode}}' wx:key='' data-index='{{index}}' data-id='{{item.id}}' catchtap='chargeStyle2' >
<view>{{item.name}}</view>
</view>
</view>
<view class='tab_content_btn' bindtap='goodScreening'>确定</view>
</view>
</view>
<!-- 价格 -->
<view class='tab_mask_box' wx:if='{{moudel2}}' bindtap='hideMask'>
<view class='tab_content_box' >
<view class='tab_content_detail'>
<view class="tab_content {{curr_state3content==item.price?'active':''}}" wx:for='{{pricelist}}' wx:key='' data-index='{{index}}' data-price='{{item.price}}' catchtap='chargeStyle3' >
<view>{{item.price}}</view>
</view>
</view>
<view class='tab_content_btn' bindtap='goodScreening'>确定</view>
</view>
</view>
<!-- 新旧程度 -->
<view class='tab_mask_box' wx:if='{{moudel2}}' bindtap='hideMask'>
<view class='tab_mask_box' wx:if='{{moudel3}}' bindtap='hideMask'>
<view class='tab_content_box' >
<view class='tab_content_detail'>
<view class="tab_content {{state3==index?'active':''}}" wx:for='{{degreelist}}' wx:key='' data-index='{{index}}' data-id='{{item.id}}' catchtap='chargeStyle3' >
<view class="tab_content {{curr_state4id==item.id?'active':''}}" wx:for='{{degreelist}}' wx:key='' data-index='{{index}}' data-id='{{item.id}}' catchtap='chargeStyle4' >
<view>{{item.degree}}</view>
</view>
</view>
<view class='tab_content_btn' bindtap='goodScreening'>确定</view>
</view>
</view>
</view>
<view class='content_item'>
<view class='item_list' wx:for='{{goodsdetaillist}}' wx:for-item='items' wx:key='' bindtap='listDetail'>
<view class='list_content_box'>
<view class='list_img'>
<image src='{{items.thumbnail}}'></image>
</view>
<view class='list_info_box'>
<view class='info_title'>
<view>
<text>{{items.brandname}}</text>
<text>{{items.color}}</text>
<text>{{items.degree}}</text>
</view>
<block wx:if='{{goodsdetaillist.length==0}}'>
<view class='nodata'>暂无数据</view>
</block>
<block wx:else>
<view class='content_item'>
<view class='item_list' wx:for='{{goodsdetaillist}}' wx:for-item='items' wx:key='' bindtap='productDetail' data-id='{{items.id}}' data-discount='{{items.price_poor}}'>
<view class='list_content_box'>
<view class='list_img'>
<image src='{{items.thumbnail}}'></image>
</view>
<view class='list_label_box'>
<view class='list_label' wx:for='{{items.attribute}}' wx:key=''>{{item}}</view>
</view>
<view class='info_money'>
<view>
<text class='money_icon'>¥</text>
<text>{{items.price}}</text>
<view class='list_info_box'>
<view class='info_title'>
<view>
<text>{{items.brandname}}</text>
<text>{{items.color}}</text>
<text>{{items.degree}}</text>
</view>
</view>
<view class='list_label_box'>
<view class='list_label' wx:for='{{items.attribute}}' wx:key=''>{{item}}</view>
</view>
<view class='info_money'>
<view>
<text class='money_icon'>¥</text>
<text>{{items.price}}</text>
</view>
</view>
<view class='list_label_box2'>
<view class='list_label2' wx:for='{{items.label}}' wx:key=''>{{item}}</view>
</view>
</view>
<view class='list_label_box2'>
<view class='list_label2' wx:for='{{items.label}}' wx:key=''>{{item}}</view>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
</block>
... ...
/* pages/classify/androidList/androidList.wxss */
page {
background: #f5f6fa;
padding:100rpx 0 0 0;
}
.tab_box {
position: relative;
position: fixed;
width: 100%;
height: 100rpx;
top:0;
left:0;
}
.tab_mask_box {
width: 100%;
height: 100%;
... ... @@ -33,13 +35,20 @@ page {
justify-content: space-between;
flex-wrap: wrap;
}
.tab_content {
width: 50%;
height: 100rpx;
line-height: 100rpx;
text-align: center;
font-size: 28rpx;
color: #333;
padding: 0 32rpx;
}
.active {
color: #0f71cd;
background: #fff;
color: #fff;
background: #0f71cd;
position: relative;
}
.active::before {
content: '';
color: #1A1A1A;
... ... @@ -50,13 +59,7 @@ page {
left: 0;
}
.tab_content {
width: 50%;
height: 100rpx;
font-size: 28rpx;
color: #333;
padding: 0 32rpx;
}
.tab_content_btn {
width: 100%;
... ... @@ -119,6 +122,7 @@ page {
}
.list_img {
margin:0 10rpx 0 0;
width: 220rpx;
height: 220rpx;
}
... ...
// pages/classify/classify.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
currenttab: 0,
goodtype: [],
goodslist: [], //一级分类
goodsdetaillist: [], //二级分类
currenttab: '', //现在对应id,不对应index
goodtype: [], //商品分类(导航)数据
goodslist: [], //一级分类数据
goodsdetaillist: [], //二级分类数据
sid: ''
},
//搜索跳转
search() {
wx.navigateTo({
url: '../classify/search/search',
})
},
//专场更多
androidMord(e) {
var id = e.currentTarget.dataset.id
... ... @@ -27,18 +24,26 @@
url: '../classify/android/android?id=' + id,
})
},
//商品分类(导航)
goodType() {
let url = 'goods/getTypeById'
let params = {}
let that = this;
let url = 'goods/getTypeById';
let params = {};
let currenttab = that.data.currenttab;
app.post(url, params).then((res) => {
if (res.data.code == 200) {
this.setData({
that.setData({
goodtype: res.data.data
})
if (currenttab == '') {
currenttab = res.data.data[0].id
that.setData({
currenttab: currenttab
})
}
that.goodType1(currenttab)
}
this.initOrder()
})
},
... ... @@ -46,54 +51,53 @@
chargeStyle(e) {
var index = e.currentTarget.dataset.index
var id = e.currentTarget.dataset.id
if (this.data.currenttab == index) {
if (this.data.currenttab == id) {
return false
} else {
this.setData({
currenttab: index,
currenttab: id,
})
}
this.goodType1(id)
},
//初始化显示第一条数据
initOrder() {
initOrder(id = '') {
var goodtype = this.data.goodtype
// console.log(this.data.goodtype)
for (var i = 0; i < goodtype.length; i++) {
this.goodType1(goodtype[0].id)
}
},
//商品分类(一级分类)
goodType1(id) {
let that = this;
let url = 'goods/getTypeById'
let params = {
parentID: id
}
app.post(url, params).then((res) => {
if (res.data.code == 200) {
this.setData({
goodslist: res.data.data,
goodsdetaillist: []
that.setData({
goodslist: res.data.data, //商品一级分类数据
goodsdetaillist: []
})
// console.log(this.data.goodslist)
}
var goodslist = this.data.goodslist
for (var i = 0; i < goodslist.length; i++) {
var id = goodslist[i].id
this.goodType2(id)
this.setData({
// mid: id
var goodslist = this.data.goodslist;
let goodsdetaillist = [];//商品二级分类数据
for (var i = 0; i < goodslist.length; i++) {
var id = goodslist[i].id
that.goodType2(id,i);
}
}else{
that.setData({
goodslist: [], //商品一级分类数据
goodsdetaillist: []
})
}
})
},
//商品分类(二级分类)
goodType2(id) {
goodType2(id,i) {
let that=this;
let url = 'goods/getTypeById'
let params = {
parentID: id
... ... @@ -101,43 +105,39 @@
let goodsdetaillist = this.data.goodsdetaillist;
app.post(url, params).then((res) => {
if (res.data.code == 200) {
goodsdetaillist.push(res.data.data)
this.setData({
goodsdetaillist[i]=res.data.data;
that.setData({
goodsdetaillist: goodsdetaillist
})
}else{
that.setData({
goodsdetaillist: []
})
}
})
},
//分类列表详情跳转(三级分类)
goodsDetail(e) {
console.log(e)
var goodslist = this.data.goodslist
var indexs = e.currentTarget.dataset.indexs //系统下标
var id = e.currentTarget.dataset.id //商品id
var sid = goodslist[indexs].id
var id = e.currentTarget.dataset.id //品牌id
var sid = goodslist[indexs].id//系统ID
wx.navigateTo({
url: '../../../androidList/androidList?id=' + id + '&sid=' + sid,
})
// for (var i = 0; i < goodslist.length; i++) {
// var Typeid = goodslist[i].id
// var sid = Typeid
// wx.navigateTo({
// url: '../../../androidList/androidList?id=' + id + '&sid=' + sid,
// })
// }
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.goodType()
let that = this;
if (options.currenttab != undefined) {
that.setData({
currenttab: parseInt(options.currenttab)
})
}
that.goodType()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ... @@ -164,7 +164,9 @@
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
wx.reLaunch({
url: '../start/start'
})
},
/**
... ...
... ... @@ -4,15 +4,15 @@
<view class='search_img'>
<image src='/images/serach.png'></image>
</view>
<view class='search_input'>华为 小米</view>
<view class='search_input'>请输入搜索关键词</view>
</view>
</view>
<view class='box'>
<view class='tabbar_box'>
<view class="tabbar_item {{currenttab==index?'active':''}}" data-index='{{index}}' data-id='{{item.id}}' wx:for='{{goodtype}}' wx:key='' bindtap='chargeStyle'>{{item.name}}</view>
<view class="tabbar_item {{currenttab==item.id?'active':''}}" data-index='{{index}}' data-id='{{item.id}}' wx:for='{{goodtype}}' wx:key='' bindtap='chargeStyle'>{{item.name}}</view>
</view>
<view class='content_item'>
<view class='item_list' wx:for='{{goodslist}}' wx:for-item='goodslist' wx:key='' wx:for-index='indexs' >
<view class='item_list' wx:for='{{goodslist}}' wx:for-item='goodslist' wx:key='' wx:for-index='indexs'>
<view class='content_title_box'>
<view>{{goodslist.name}}</view>
<view data-id='{{goodslist.id}}' bindtap='androidMord'>更多</view>
... ...
... ... @@ -118,7 +118,7 @@
.list_content_images {
width: 140rpx;
height: 140rpx;
margin-left: 11rpx;
margin-left: 20rpx;
margin-bottom: 24rpx;
}
... ...
... ... @@ -24,6 +24,14 @@ Page({
url: '../searchResults/searchResults?key=' + key,
})
},
gosearchcontent(e){
console.log(e)
let key=e.currentTarget.dataset.key;
wx.navigateTo({
url: '../searchResults/searchResults?key=' + key,
})
},
//搜索历史接口
searchHistory(){
... ... @@ -72,7 +80,9 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
wx.reLaunch({
url: '../start/start'
})
},
/**
... ...
... ... @@ -5,7 +5,7 @@
<image src='/images/serach.png'></image>
</view>
<view class='search_input'>
<input placeholder='华为 小米' bindinput='inputSearch' ></input>
<input placeholder='请输入关键词' bindinput='inputSearch' ></input>
</view>
</view>
<view bindtap='searchContent'>搜索</view>
... ... @@ -13,6 +13,6 @@
<view class='content_item'>
<view class='content_title'>最近搜索</view>
<view class='list_content'>
<view class='item_list' wx:for='{{historylist}}' wx:key=''>{{item.search_records}}</view>
<view class='item_list' wx:for='{{historylist}}' wx:key='' data-key='{{item.search_records}}' bindtap='gosearchcontent' >{{item.search_records}}</view>
</view>
</view>
\ No newline at end of file
... ...
... ... @@ -9,7 +9,6 @@ Page({
key: '',
searchlist: [],
},
//搜索调取接口
searchContent() {
let url = 'goods/goodSearch'
... ... @@ -18,15 +17,20 @@ Page({
key: this.data.key
}
app.post(url, params).then((res) => {
console.log(res)
if (res.data.code == 200) {
this.setData({
searchlist: res.data.data
})
}else{
this.setData({
searchlist: []
})
}
}).catch((errMsg)=>{
console.log(errMsg)
})
},
//搜索列表商品详情接口
goodsDetail(e) {
var goods_id = e.currentTarget.dataset.id
... ... @@ -34,18 +38,25 @@ Page({
url: '../../index/productDetail/productDetail?goods_id=' + goods_id,
})
},
//取消搜索框值
cancenKey() {
setinput(e){
console.log(e)
let key=e.detail.value;
this.setData({
key: ''
key:key
})
},
//重置搜索关键词
cancenKey() {
let that=this;
that.searchContent();
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
console.log(options)
this.setData({
key: options.key
})
... ... @@ -77,7 +88,9 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
wx.reLaunch({
url: '../start/start'
})
},
/**
... ...
<!--pages/classify/searchResults/searchResults.wxml-->
<view class='search_box'>
<view class='search_box'>
<view class='search'>
<view class='search_img'>
<image src='/images/serach.png'></image>
</view>
<view class='search_input'>
<input placeholder='{{key}}' value='{{key}}'></input>
<input value='{{key}}' bindinput='setinput'></input>
</view>
</view>
<view bindtap='cancenKey'>取消</view>
<view bindtap='cancenKey'>搜索</view>
</view>
<view class='content_item'>
<view class='item_list' wx:for='{{searchlist}}' wx:for-item='items' wx:key='' data-id='{{items.id}}' bindtap='goodsDetail'>
<view class='list_content_box'>
<view class='list_img'>
<image src='{{items.thumbnail}}'></image>
</view>
<view class='list_info_box'>
<view class='info_title'>
<view>
<text>{{items.brandname}}</text>
<text>{{items.color}}</text>
<text>{{items.degree}}</text>
</view>
<block wx:if='{{searchlist.length==0}}'>
<view class='nodata'>暂无数据</view>
</block>
<block wx:else>
<view class='content_item' >
<view class='item_list' wx:for='{{searchlist}}' wx:for-item='items' wx:key='' data-id='{{items.id}}' bindtap='goodsDetail'>
<view class='list_content_box'>
<view class='list_img'>
<image src='{{items.thumbnail}}'></image>
</view>
<view class='list_label_box'>
<view class='list_label' wx:for='{{items.attribute}}' wx:key=''>{{item}}</view>
</view>
<view class='info_money' wx:if='{{items.Sales_type==1}}'>
<view>
<text class='money_icon'>¥</text>
<text>{{items.price}}</text>
<view class='list_info_box'>
<view class='info_title'>
<view>
<text>{{items.brandname}}</text>
<text>{{items.color}}</text>
<text>{{items.degree}}</text>
</view>
</view>
</view>
<view class='info_money' wx:if='{{items.Sales_type==3}}'>
<view class='money_box'>
<text class='money_icon'>¥</text>
<text>2899</text>
<view class='original_price'>¥3899</view>
<view class='list_label_box'>
<view class='list_label' wx:for='{{items.attribute}}' wx:key=''>{{item}}</view>
</view>
<view class='info_money' wx:if='{{items.Sales_type==1}}'>
<view>
<text class='money_icon'>¥</text>
<text>{{items.price}}</text>
</view>
</view>
<view class='info_money' wx:if='{{items.Sales_type==3}}'>
<view class='money_box'>
<text class='money_icon'>¥</text>
<text>2899</text>
<view class='original_price'>¥3899</view>
</view>
</view>
<view class='list_label_box2'>
<view class='list_label2' wx:for='{{items.label}}' wx:key=''>{{item}}</view>
</view>
</view>
<view class='list_label_box2'>
<view class='list_label2' wx:for='{{items.label}}' wx:key=''>{{item}}</view>
</view>
<view class='info_money' wx:if='{{items.Sales_type==2}}'>
<view>
<text class='money_icon'>¥</text>
<text>2899</text>
<view class='info_money' wx:if='{{items.Sales_type==2}}'>
<view>
<text class='money_icon'>¥</text>
<text>2899</text>
</view>
<view class='money_btn'>去秒杀</view>
</view>
<view class='money_btn'>去秒杀</view>
</view>
</view>
</view>
</view>
<!-- <view class='item_list'>
<view class='list_content_box'>
<view class='list_img'>
<image src='/images/apic01@2x.png'></image>
</view>
<view class='list_info_box'>
<view class='info_title'>
<view>
<text>华为P10</text>
<text>金色</text>
<text>全新</text>
</view>
<view class='price'>降¥1000</view>
</view>
<view class='list_label_box'>
<view class='list_label' wx:for='{{[1,2,3,4]}}' wx:key=''>华为(HUAWEI)</view>
<!-- <view class='item_list'>
<view class='list_content_box'>
<view class='list_img'>
<image src='/images/apic01@2x.png'></image>
</view>
<view class='info_money'>
<view class='money_box'>
<text class='money_icon'>¥</text>
<text>2899</text>
<view class='original_price'>¥3899</view>
<view class='list_info_box'>
<view class='info_title'>
<view>
<text>华为P10</text>
<text>金色</text>
<text>全新</text>
</view>
<view class='price'>降¥1000</view>
</view>
<view class='list_label_box'>
<view class='list_label' wx:for='{{[1,2,3,4]}}' wx:key=''>华为(HUAWEI)</view>
</view>
<view class='info_money'>
<view class='money_box'>
<text class='money_icon'>¥</text>
<text>2899</text>
<view class='original_price'>¥3899</view>
</view>
</view>
<view class='list_label_box2'>
<view class='list_label2' wx:for='{{[1,2,3,4,5]}}' >原装</view>
</view>
</view>
<view class='list_label_box2'>
<view class='list_label2' wx:for='{{[1,2,3,4,5]}}' >原装</view>
</view>
</view>
</view>
</view>
<view class='item_list'>
<view class='list_content_box'>
<view class='list_img'>
<image src='/images/apic01@2x.png'></image>
</view>
<view class='list_info_box'>
<view class='info_title'>
<view>
<text>华为P10</text>
<text>金色</text>
<text>全新</text>
</view>
</view>
<view class='list_label_box'>
<view class='list_label' wx:for='{{[1,2,3,4]}}'>华为(HUAWEI)</view>
<view class='item_list'>
<view class='list_content_box'>
<view class='list_img'>
<image src='/images/apic01@2x.png'></image>
</view>
<view class='list_label_box2'>
<view class='list_label2' wx:for='{{[1,2,3,4,5]}}'>原装</view>
</view>
<view class='info_money'>
<view>
<text class='money_icon'>¥</text>
<text>2899</text>
<view class='list_info_box'>
<view class='info_title'>
<view>
<text>华为P10</text>
<text>金色</text>
<text>全新</text>
</view>
</view>
<view class='list_label_box'>
<view class='list_label' wx:for='{{[1,2,3,4]}}'>华为(HUAWEI)</view>
</view>
<view class='list_label_box2'>
<view class='list_label2' wx:for='{{[1,2,3,4,5]}}'>原装</view>
</view>
<view class='info_money'>
<view>
<text class='money_icon'>¥</text>
<text>2899</text>
</view>
<view class='money_btn'>去秒杀</view>
</view>
<view class='money_btn'>去秒杀</view>
</view>
</view>
</view>
</view> -->
</view> -->
</view>
</block>
</view>
\ No newline at end of file
... ...
... ... @@ -51,6 +51,7 @@ page{
margin-bottom: 60rpx;
}
.list_title_box {
margin:0 10rpx 0 0;
font-size: 26rpx;
color: #666;
display: flex;
... ...
... ... @@ -11,7 +11,11 @@ Page({
discountlist: [],
discount: ''
},
onTabItemTap(item) {
console.log(item.index)
console.log(item.pagePath)
console.log(item.text)
},
//获取轮播当前页
swiperCharge(e) {
this.setData({
... ... @@ -19,12 +23,12 @@ Page({
})
},
//商品分类跳转
classify() {
classify(e) {
console.log(e)
wx.reLaunch({
url: '../classify/classify',
url: '../classify/classify?currenttab='+e.currentTarget.dataset.id,
})
},
//新品推荐
newProduct() {
var discount = 0
... ... @@ -32,7 +36,6 @@ Page({
url: '../index/productRecommend/productRecommend?discount=' + discount,
})
},
//降价处理
sale() {
var discount = 1
... ... @@ -44,7 +47,7 @@ Page({
//商品详情
productDetail(e) {
console.log(e)
console.log(e.currentTarget.dataset.discount)
var goods_id = e.currentTarget.dataset.id
var discount = e.currentTarget.dataset.discount ? 1 : 0
wx.navigateTo({
... ... @@ -102,11 +105,29 @@ Page({
this.setData({
discountlist: res.data.data
})
console.log(res.data.data)
}
})
},
//购物车数量
getcartsnum() {
let url = 'shop/getShopNum';
app.post(url, {
users_id: app.globalData.users_id
}).then((res) => {
if (res.data.code == 200) {
if (res.data.data>=1){
app.globalData.cartnum = JSON.stringify(res.data.data);
wx.setTabBarBadge({
index: 3,
text: JSON.stringify(res.data.data)
})
}
}
})
},
/**
* 生命周期函数--监听页面加载
... ... @@ -116,8 +137,9 @@ Page({
this.goodType(); //商品分类banner
this.newGoods(); //新品推荐
this.discountSale(); //降价出售接口
this.getcartsnum()
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
... ... @@ -129,6 +151,11 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function() {
this.getindexBanner(); //轮播图
this.goodType(); //商品分类banner
this.newGoods(); //新品推荐
this.discountSale(); //降价出售接口
this.getcartsnum();
},
... ... @@ -143,6 +170,9 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
wx.reLaunch({
url: '../start/start'
})
},
... ...
... ... @@ -32,6 +32,7 @@
</view>
<view class='list_content_box' wx:for='{{newgoods}}' wx:key='' wx:for-item='items' data-id='{{items.id}}' bindtap='productDetail'>
<view class='list_img'>
<view class="img_no" wx:if="{{items.goods_state=='售罄'}}"><image src="/images/yishouwan@2x.png"></image></view>
<image src='{{items.thumbnail}}'></image>
</view>
<view class='list_info_box'>
... ... @@ -67,6 +68,7 @@
</view>
<view class='list_content_box' wx:for='{{discountlist}}' wx:for-item='discount' wx:key='' data-id='{{discount.id}}' data-discount='{{discount.price_poor}}' bindtap='productDetail'>
<view class='list_img'>
<view class="img_no" wx:if="{{discount.goods_state=='售罄'}}"><image src="/images/yishouwan@2x.png"></image></view>
<image src='{{discount.thumbnail}}'></image>
</view>
<view class='list_info_box'>
... ...
... ... @@ -79,9 +79,17 @@ page {
justify-content: space-between;
}
.list_img{
position: relative;
margin:0 10rpx 0 0;
width: 220rpx;
height: 220rpx;
}
.list_img .img_no{
position:absolute;
top:56rpx;
left:50%;
transform: translateX(-50%)
}
.list_img image{
width: 100%;
height: 100%;
... ...
... ... @@ -7,7 +7,7 @@ Page({
*/
data: {
discountlist: [],
sort:'',
sort:'',//1,2
discount:'',
},
... ... @@ -25,23 +25,29 @@ Page({
},
//降价商品排序
sort(e) {
var sort = e.currentTarget.dataset.sort
sort() {
let that=this;
if (that.data.sort=='1'){
that.setData({
sort:'2'
})
}else{
that.setData({
sort: '1'
})
}
let url = 'goods/all_discount'
let params = {
sortId: sort
sortId: that.data.sort
}
app.post(url, params).then((res) => {
if (res.data.code == 200) {
this.setData({
discountlist: res.data.data,
sort: sort
})
}
})
},
//商品详情
listDetail(e) {
var goods_id = e.currentTarget.dataset.id
... ... @@ -87,7 +93,9 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
wx.reLaunch({
url: '../start/start'
})
},
/**
... ...
<!--pages/index/onSale/onSale.wxml-->
<view class='content_item'>
<view class='item_list'>
<view class='list_title_box'>
<view class='list_title_box' bindtap='sort'>
<view>降价幅度</view>
<view class='icon_box'>
<view class="iconfont icon-arr-top {{sort==2?'active':''}} " bindtap='sort' data-sort='2'></view>
<view class="iconfont icon-arrLeft-fill1 {{sort==1?'active':''}} " bindtap='sort' data-sort='1'></view>
<view class="iconfont icon-arr-top {{sort==2?'active':''}} " ></view>
<view class="iconfont icon-arrLeft-fill1 {{sort==1?'active':''}} " ></view>
</view>
</view>
<view class='list_content_box' wx:for='{{discountlist}}' wx:for-item='items' wx:key='' data-id='{{items.id}}' bindtap='listDetail'>
<view class='list_img'>
<view class="img_no" wx:if="{{items.goods_state=='售罄'}}"><image src="../../../images/yishouwan@2x.png"></image></view>
<image src='{{items.thumbnail}}'></image>
</view>
<view class='list_info_box'>
... ...
... ... @@ -41,10 +41,16 @@ page {
border: 1rpx greenyellow;
}
.list_img {
position: relative;
width: 220rpx;
height: 220rpx;
margin:0 10rpx 0 0;
}
.list_img .img_no{
position:absolute;
top:56rpx;
left:42rpx;
}
.list_img image {
width: 100%;
height: 100%;
... ...
... ... @@ -2,8 +2,7 @@
const app = getApp()
var WxParse = require('../../../wxParse/wxParse.js');
Page({
/**
/**
* 页面的初始数据
*/
data: {
... ... @@ -11,11 +10,11 @@ Page({
swipercurrent: 0,
pages: 0,
goods_id: '',
discount: '', //降价字段
seckillstatus: '',//0秒杀结束,1秒杀中,2未开场
discount: '', //降价字段1为降价销售,0为正常销售,2为秒杀专场
listdetail: [],
num: 0, //购物车数量
cartslen: 0, //购物车数量
},
//轮播图总页数
swiperpages() {
var pages = (this.data.imgUrls).length
... ... @@ -23,7 +22,6 @@ Page({
pages: pages
})
},
//获取轮播图当前页
swiperCharge(e) {
this.setData({
... ... @@ -49,47 +47,109 @@ Page({
}
})
},
//添加商品
addGoods() {
this.setData({
num: (this.data.num) + 1
})
let url = 'shop/addShop'
let params = {
users_id: app.globalData.users_id,
goods_id: this.data.goods_id,
num: this.data.num
}
app.post(url,params).then((res)=>{
if(res.data.code==1){
wx.showToast({
title: '添加成功',
icon: 'none',
//获取购物车数据
getcartlen(){
let that=this
let url ='shop/getShopNum';
app.post(url,{users_id: app.globalData.users_id}).then((res)=>{
if (res.data.code==200){
that.setData({
cartslen:res.data.data
})
app.globalData.cartnum = JSON.stringify(res.data.data)
}
}).catch((errMsg)=>{
console.log(errMsg)
})
},
//立即购买
goBuy(){
//添加商品
addGoods(e) {
let that=this;
let listdetail = that.data.listdetail;
let numtag = listdetail.number;
console.log(numtag)
if (numtag== 0){
wx.showToast({
title: '商品库存不足',
icon: 'none',
duration: 2000,
})
setTimeout(function(){
wx.navigateBack({
delta: 1
})
},2000)
}else{
let url = 'shop/addShop'
let params = {
users_id: app.globalData.users_id,
goods_id: this.data.goods_id,
num: 1
}
app.post(url, params).then((res) => {
if (res.data.code == 1) {
that.getcartlen();//获取购物车数量
}
})
}
},
goshopcar(){
wx.switchTab({
url: '../../shopcar/shopcar',
})
},
//立即购买
goBuy(){
let that = this;
if (that.data.seckillstatus=='0'){
wx.showToast({
title: '秒杀已结束~',
icon: 'none',
duration: 2000
})
} else if (that.data.seckillstatus=='2'){
wx.showToast({
title: '等待开场哟~',
icon: 'none',
duration: 2000
})
}else{
let listdetail = that.data.listdetail;
let numtag = listdetail.number;
if (numtag == 0) {
wx.showToast({
title: '商品库存不足',
icon: 'none',
duration: 2000,
})
setTimeout(function () {
wx.navigateBack({
delta: 1
})
}, 2000)
} else {
wx.navigateTo({
url: '../../shopcar/confirmOrder/confirmOrder?goods_id=' + this.data.listdetail.id + '&goods_num=1' + '&price=' + this.data.listdetail.price + '&cart_ids=' + '',
})
}
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
var goods_id = options.goods_id
var goods_id = options.goods_id//商品ID
var discount = options.discount
this.setData({
goods_id: goods_id,
discount: discount
discount: discount,
seckillstatus: options.seckillstatus
})
this.swiperpages()
this.listDetail()
this.swiperpages();
this.listDetail();
this.getcartlen();
},
/**
... ... @@ -117,7 +177,9 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
wx.reLaunch({
url: '../start/start'
})
},
/**
... ...
... ... @@ -14,7 +14,6 @@
<view>{{imgUrls.length}}</view>
</view>
</view>
<view class='content_item'>
<view class='item_list'>
<view class='list_info_box'>
... ... @@ -68,13 +67,19 @@
</view>
<view class='null_box'></view>
<view class='bottom_box'>
<view class='shop_car_btn'>
<view class='goods_num'>{{num}}</view>
<block wx:if='{{discount==2}}'>
<view class="{{seckillstatus==1?'sec_btn':'sec_btn_no'}}" bindtap='goBuy'>立即购买</view>
</block>
<block wx:else>
<view class='shop_car_btn' bindtap='goshopcar'>
<view class='goods_num' wx:if='{{cartslen != 0}}'>{{cartslen}}</view>
<view class='shop_car'>
<view class='iconfont icon-gouwuche-copy'></view>
</view>
<view>购物车</view>
</view>
<view class='join_btn' bindtap='addGoods'>加入购物车</view>
<view class='join_btn' bindtap='addGoods' >加入购物车</view>
<view class='buy_btn' bindtap='goBuy'>立即购买</view>
</block>
</view>
\ No newline at end of file
... ...
... ... @@ -178,15 +178,15 @@ page {
font-size: 48rpx;
color: #999;
}
.goods_num {
width: 38rpx;
height: 28rpx;
height: 38rpx;
font-size: 24rpx;
color: #0f71cd;
border: 1rpx solid #0f71cd;
border-radius: 10rpx;
background: #fff;
font-weight: bold;
color: #fff;
border: 1rpx solid #f43530;
border-radius: 50%;
background: #f43530;
display: flex;
align-items: center;
justify-content: center;
... ... @@ -214,3 +214,25 @@ page {
background: #0f71cd;
color: #fff;
}
.sec_btn{
width:100%;
background:#0f71cd;
color:#fff;
height:100%;
font-size:30rpx;
display:flex;
align-items:center;
justify-content:center;
}
.sec_btn_no{
width:100%;
background:#b2b2b2;
color:#fff;
height:100%;
font-size:30rpx;
display:flex;
align-items:center;
justify-content:center;
}
\ No newline at end of file
... ...
... ... @@ -68,7 +68,9 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
wx.reLaunch({
url: '../start/start'
})
},
/**
... ...
... ... @@ -6,6 +6,7 @@
</view>
<view class='list_content_box' wx:for='{{allnewgoods}}' wx:for-item='items' wx:key='' data-id='{{items.id}}' bindtap='listDetail'>
<view class='list_img'>
<view class="img_no" wx:if="{{items.goods_state=='售罄'}}"><image src="../../../images/yishouwan@2x.png"></image></view>
<image src='{{items.thumbnail}}'></image>
</view>
<view class='list_info_box'>
... ...
... ... @@ -17,8 +17,15 @@ page {
justify-content: space-between;
}
.list_img{
position: relative;
width: 220rpx;
height: 220rpx;
margin:0 10rpx 0 0;
}
.list_img .img_no{
position:absolute;
top:56rpx;
left:42rpx;
}
.list_img image{
width: 100%;
... ...
... ... @@ -2,7 +2,7 @@
const app = getApp()
Page({
/**
/**
* 页面的初始数据
*/
data: {
... ... @@ -10,16 +10,16 @@ Page({
portrait: '',
nickname: '',
phone: '',
len:0
},
//获取用户信息接口、
//获取用户信息接口
userInfo() {
let url = 'users/getUsers'
let params = {
users_id: app.globalData.users_id,
}
app.post(url, params).then((res) => {
console.log(res)
if (res.data.code == 200) {
this.setData({
userinfo: res.data.data,
... ... @@ -40,21 +40,29 @@ Page({
url: '../spare/editProfile/editProfile?portrait=' + portrait + '&nickname=' + nickname + '&phone=' + phone,
})
},
//全部订单
allOrder() {
wx.navigateTo({
url: '../spare/allOrder/allOrder',
})
},
//待付款详情
waitPay(e) {
var state = e.currentTarget.dataset.state
wx.navigateTo({
url: '../spare/allOrder/allOrder?state=' + state,
})
},
//获取待付款数据
getdfklenght(){
let that=this;
let url = 'users/getOrderList'
let params = {
users_id: app.globalData.users_id,
state: 0 //0未支付,1已支付,2已发货,3已完成,4查全部
}
app.post(url, params).then((res) => {
if (res.data.code == 200) {
let goodslist = res.data.data
that.setData({
len: goodslist.length
})
}
})
},
//待付款详情
waitPay(e) {
... ... @@ -75,11 +83,16 @@ Page({
wx.navigateTo({
url: '../spare/allOrder/allOrder?state=' + state,
})
} else if (state == 4){
wx.navigateTo({
url: '../spare/allOrder/allOrder?state=' + state,
})
}
},
//地址管理
addressManagement() {
wx.setStorageSync('from', 'frommy')
wx.navigateTo({
url: '../spare/addressManagement/addressManagement',
})
... ... @@ -97,35 +110,35 @@ Page({
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.userInfo()
this.userInfo();
this.getdfklenght();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
this.userInfo()
this.userInfo();
this.getdfklenght();
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
wx.reLaunch({
url: '../start/start'
})
},
/**
... ...
... ... @@ -14,7 +14,7 @@
<view class='iconfont icon-wodedingdan'></view>
<view>我的订单</view>
</view>
<view class='list_title' bindtap='allOrder'>
<view class='list_title' bindtap='waitPay' data-state='4' >
<view>全部</view>
<view class='iconfont icon-fanhui'></view>
</view>
... ... @@ -29,7 +29,7 @@
<view >待付款</view>
</view>
<!-- <view class='iconfont icon-1'></view> -->
<view class='order_num'>1</view>
<view class='order_num' wx:if='{{len !=0 }}'>{{len}}</view>
</view>
<view class='list_content' bindtap='waitPay' data-state='1'>
<view>
... ...
const app = getApp()
var time = require('../../utils/util.js')
Page({
/**
* 页面的初始数据
*/
data: {
orderlist: [],
TimeInterval: [],
currentid:'',//当前秒杀时间段调用的id
clock: '',
hour: '',
minute: '',
second: '',
countdown: '',
endTime: ''
endTime: '',
currentstate:true
},
//获取秒杀时间段
//获取秒杀时间段,并获取正在秒杀场次开始数据
getTimeInterval() {
let that=this;
let url = 'goods/getTimeIntervalState'
let params = {}
let params = {};
app.post(url, params).then((res) => {
console.log(res)
if (res.data.code == 200) {
var TimeInterval = res.data.data
for (var i = 0; i < TimeInterval.length; i++) {
TimeInterval[i]["start_time"] = time.timestampToTime(TimeInterval[i]["start_time"],0)
TimeInterval[i]["end_time"] = time.timestampToTime(TimeInterval[i]["end_time"],1)
var TimeInterval = Object.assign([], res.data.data)
for (var i = 0; i < TimeInterval.length; i++) {
TimeInterval[i].start_times = time.timestampToTime(res.data.data[i].start_time,0)
TimeInterval[i].end_times = time.timestampToTime(res.data.data[i].end_time,1)
TimeInterval[i].currentday = time.timestampToTime(res.data.data[i].start_time,2);
TimeInterval[i].statefag = false;
if (TimeInterval[i].state == 1) {
TimeInterval[i].statefag = true;
this.setData({
endTime: TimeInterval[i]["end_time"]
endTime: TimeInterval[i].end_times,
currentid: TimeInterval[i].id
})
this.countTime()
that.countTime();
that.secondsKill(TimeInterval[i].currentday, TimeInterval[i].id,
TimeInterval[i].state);
}else{
TimeInterval[i].statefag = false;
}
}
this.setData({
//判断显示那些数据,TimeInterval里面的数据有state == 1(正在秒杀中)调用正在秒杀数据
//否则调用第一场数据
let currentday;
let id;
let state;
for (var i = 0; i<TimeInterval.length;i++){
if (TimeInterval[i].state == 1) {
TimeInterval[i].statefag = true;
this.setData({
endTime: TimeInterval[i].end_times,
currentid: TimeInterval[i].id
})
currentday = TimeInterval[i].currentday;
id = TimeInterval[i].id;
state = TimeInterval[i].id;
} else {
TimeInterval[0].statefag = true;
this.setData({
endTime: TimeInterval[0].end_times,
currentid: TimeInterval[0].id
})
currentday = TimeInterval[0].currentday;
id = TimeInterval[0].id;
state = TimeInterval[0].id;
}
}
that.countTime();
that.secondsKill(currentday, id,state);
that.setData({
TimeInterval: TimeInterval
})
}
console.log(res.data.data)
})
}
})
},
//秒杀倒计时
countTime() {
var that = this;
... ... @@ -70,62 +104,89 @@ Page({
//递归每秒调用countTime方法,显示动态时间效果
setTimeout(that.countTime, 100);
} else {
console.log('已截止')
that.setData({
countdown: '00:00:00',
hour: '00',
minute: '00',
second: '00',
})
// that.getTimeInterval();
}
},
//点击顶部tab调接口
againset(e){
let that=this;
let TimeInterval = that.data.TimeInterval;
let id = e.currentTarget.id;
let currentstate = e.currentTarget.dataset.state;
for (let obj of TimeInterval){
obj.statefag=false;
if(obj.id == id){
obj.statefag=true;
}
}
that.setData({
TimeInterval: TimeInterval,
currentstate: currentstate=='1'?true:false//等于true显示当前时间,false结束时间
})
that.secondsKill(e.currentTarget.dataset.currentday, e.currentTarget.id, e.currentTarget.dataset.state)
},
//秒杀专场商品列表
secondsKill() {
secondsKill(day = '', id = '', seckillstatus='') {
let url = 'goods/snapUpList'
let params = {
day: '2018-08-30',
time: '1'
day: day,
time: id
}
app.post(url, params).then((res) => {
if (res.data.code == 200) {
let orderlist=res.data.data;
for (let obj of orderlist){
obj.seckillstatus = seckillstatus;//0秒杀结束,1秒杀中,2未开场
}
this.setData({
orderlist: res.data.data
orderlist: orderlist
})
}
})
},
// 跳转商品详情
productDetail(e) {
var goods_id = e.currentTarget.dataset.goods_id
console.log(e)
var goods_id = e.currentTarget.dataset.id;
var seckillstatus = e.currentTarget.dataset.seckillstatus;
wx.navigateTo({
url: '../index/productDetail/productDetail?goods_id=' + goods_id,
url: '../index/productDetail/productDetail?goods_id=' + goods_id + '&discount=' + 2 + '&seckillstatus=' + seckillstatus,
})
wx.showToast({
title: '该场未开始~',
icon: 'none'
}, 2000)
},
//已结束
productDetailend(){
wx.showToast({
title: '该场已结束~',
icon: 'none'
}, 2000)
},
//未开场
productDetailstart(){
wx.showToast({
title: '请等待开场~',
icon: 'none'
}, 2000)
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.secondsKill()
let that=this;
this.getTimeInterval()
// countdown(this);
var that = this;
//倒计时
this.countTime()
},
... ... @@ -140,7 +201,10 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow: function() {
this.getTimeInterval()
// countdown(this);
var that = this;
this.countTime()
},
/**
... ... @@ -154,7 +218,9 @@ Page({
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
wx.reLaunch({
url: '../start/start'
})
},
/**
... ...
<!--pages/secondsKill/secondsKill.wxml-->
<scroll-view>
<view class='banner_box'>
<view class='active' wx:for='{{TimeInterval}}' wx:key=''>
<view class="time {{item.state==1?'active1':''}}">{{item.start_time}}</view>
<view class='active' wx:for='{{TimeInterval}}' wx:key='' id='{{item.id}}' data-currentday='{{item.currentday}}' data-state='{{item.state}}' bindtap='againset'>
<view class="time {{item.statefag?'active1':''}}">{{item.start_times}}</view>
<view wx:if='{{item.state==0}}'>已结束</view>
<view wx:elif='{{item.state==1}}' class="{{item.state==1?'active1':''}}">秒杀中</view>
<view wx:elif='{{item.state==2}}'>待开场</view>
... ... @@ -11,8 +11,8 @@
</scroll-view>
<view class='content_item'>
<view class='list_title_box'>
<view>华为专场</view>
<view class='end_time_box'>
<view>秒杀专场</view>
<view class='end_time_box' wx:if='{{currentstate}}'>
<text>距结束</text>
<view class='end_time'>
<!-- {{clock}} -->
... ... @@ -23,34 +23,53 @@
<view class='time_box'>{{second}}</view>
</view>
</view>
</view>
<view class='item_list'>
<view class='list_content_box' wx:for='{{orderlist}}' wx:for-item='items' wx:key=''>
<view class='list_img'>
<image src='{{items.thumbnail}}'></image>
<view class='end_time_box' wx:else>
<text>距结束</text>
<view class='end_time'>
<!-- {{clock}} -->
<view class='time_box'>00</view>
<view class='time_dot'>:</view>
<view class='time_box'>00</view>
<view class='time_dot'>:</view>
<view class='time_box'>00</view>
</view>
<view class='list_info_box'>
<view class='info_title'>
<view>
<text>{{items.brandname}}</text>
<text>{{items.color}}</text>
<text>{{items.degree}}</text>
</view>
</view>
<view class='list_label_box'>
<view class='list_label' wx:for='{{items.attribute}}' wx:key=''>{{item}}</view>
</view>
<view class='list_label_box2'>
<view class='list_label2' wx:for='{{items.label}}' wx:key=''>{{item}}</view>
</view>
</view>
<block wx:if='{{orderlist.length==0}}'>
<view class='nodata'>暂无数据</view>
</block>
<block wx:else>
<view class='item_list'>
<view class='list_content_box' wx:for='{{orderlist}}' wx:for-item='items' wx:key='' bindtap='productDetail' data-id='{{items.id}}' data-seckillstatus='{{items.seckillstatus}}'>
<view class='list_img'>
<view class="img_no" wx:if="{{items.goods_state=='售罄'}}"><image src="/images/yishouwan@2x.png"></image></view>
<image src='{{items.thumbnail}}'></image>
</view>
<view class='info_money'>
<view>
<text class='money_icon'>¥</text>
<text>{{items.price}}</text>
<view class='list_info_box'>
<view class='info_title'>
<view>
<text>{{items.brandname}}</text>
<text>{{items.color}}</text>
<text>{{items.degree}}</text>
</view>
</view>
<view class='list_label_box'>
<view class='list_label' wx:for='{{items.attribute}}' wx:key=''>{{item}}</view>
</view>
<view class='list_label_box2'>
<view class='list_label2' wx:for='{{items.label}}' wx:key=''>{{item}}</view>
</view>
<view class='info_money'>
<view>
<text class='money_icon'>¥</text>
<text>{{items.price}}</text>
</view>
<view class="money_btn" bindtap='productDetail' data-goods_id='{{items.id}}' wx:if='{{items.seckillstatus==1}}' data-id='{{items.id}}' data-seckillstatus='{{items.seckillstatus}}'>去秒杀</view>
<view class="money_btnclolr" bindtap='productDetailend' data-goods_id='{{items.id}}' wx:elif='{{items.seckillstatus==0}}' data-id='{{items.id}}' data-seckillstatus='{{items.seckillstatus}}'>已结束</view>
<view class="money_btnclolr" bindtap='productDetailstart' data-goods_id='{{items.id}}' wx:elif='{{items.seckillstatus==2}}' data-id='{{items.id}}' data-seckillstatus='{{items.seckillstatus}}'>未开场</view>
</view>
<view class='money_btn' bindtap='productDetail' data-goods_id='{{items.id}}'>去秒杀</view>
</view>
</view>
</view>
</view>
</block>
</view>
\ No newline at end of file
... ...
... ... @@ -28,17 +28,18 @@ page {
.content_item {
background: #fff;
margin-top: 16rpx;
padding: 35rpx 0rpx;
padding: 0 0 35rpx 0;
}
.list_title_box {
font-size: 26rpx;
color: #666;
border-bottom: 1rpx solid #ebebeb;
padding: 0 32rpx 32rpx 32rpx;
padding: 35rpx 32rpx 32rpx 32rpx;
display: flex;
align-items: center;
justify-content: space-between;
background-color: #fff;
}
.end_time_box {
... ... @@ -68,14 +69,21 @@ page {
}
.item_list {
background-color: #fff;
padding: 0 32rpx;
}
.list_img {
position: relative;
margin:0 10rpx 0 0;
width: 220rpx;
height: 220rpx;
}
.list_img .img_no{
position:absolute;
top:56rpx;
left:50%;
transform: translateX(-50%)
}
.list_img image {
width: 100%;
height: 100%;
... ... @@ -172,3 +180,14 @@ page {
padding: 3rpx 10rpx;
margin: 0 10rpx 10rpx 0;
}
.money_btnclolr {
width: 160rpx;
height: 50rpx;
font-size: 24rpx;
color: #fff;
background: #ddd;
border-radius: 25rpx;
display: flex;
align-items: center;
justify-content: center;
}
... ...