作者 lihongjuan

上传

... ... @@ -21,7 +21,7 @@
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "团购商城",
"navigationBarTitleText": "壹万商城",
"navigationBarTextStyle": "black"
},
"tabBar": {
... ...
@font-face {font-family: "iconfont";
src: url('//at.alicdn.com/t/font_1179697_fbyb0ah1aok.eot?t=1557278553716'); /* IE9 */
src: url('//at.alicdn.com/t/font_1179697_fbyb0ah1aok.eot?t=1557278553716#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAKAAAsAAAAABigAAAI0AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCCcAosRwE2AiQDCAsGAAQgBYRtBzYbcwUR1Yshsj9AJre6AwBJRxHkIEu13DMydnmg7MP5ASaFryABAAAAAOLhv/1Y9/0ZVJNq4lBNmmgik/DQNUFqhEgo0PEIq3GTJiDPRIKDAPTZwif+zWnqv0UmSIBkwuedk3vIK0M+R+lgqADB5lfWewAkApRyMQz5PJfTu10cyPxAue5BY02aNIB6cUCB7YlRZAUSesPYBS/wMYFKHcbEwuX9O5TL7FWB2E9BQ3khLMssVy6UNhzM4gZKlBdXx3tcR9+P78ajnEJJYjes7V04mPngFCT/dgMCIgR0vAQJY8jEVmN6RRJMlFSmsx6OVRt8+P8/cImj2gX76+zqatAGM8EHb6UABTwWpb960nSi9MCHF0d/nbOFmw8z4L+jtPpVMPl76v6lDB5f0ZL/zktdKF/PE7y/cmBPNtS2s8iasnG4ULrfpkqV+B/2N3qfamk5WT6Ua5ngLdOeISnXR2Z2DCWqTKBUuWlUGrV8vEqTU0nkCow4Awj1blGodYek3gOZ2TeUaPUTpeojodJOdGGVgTCTWkkLOTS/mCyv3nWLimtfKeyzrnl1JP6kuqUYDm1fzl3RSnWJLdtXGEU8+soLXoLnaJ4ZS+VMVtooUk5d55ve1FpeQMFKWsih+cVkefXBaFGVz79S2GddO7rqip9UtzQ5Dm0/gLwyrIO6HuWV7SuMIh595QUvwTyaZ8bSPC+TlTZOSJZT5wzyQw3t9qbl744BoMC2Hg/O7kROehXeG8vlFwAAAA==') format('woff2'),
url('//at.alicdn.com/t/font_1179697_fbyb0ah1aok.woff?t=1557278553716') format('woff'),
url('//at.alicdn.com/t/font_1179697_fbyb0ah1aok.ttf?t=1557278553716') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
url('//at.alicdn.com/t/font_1179697_fbyb0ah1aok.svg?t=1557278553716#iconfont') format('svg'); /* iOS 4.1- */
}
.iconfont {
font-family: "iconfont" !important;
font-size: 16px;
font-style: normal;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
.icon-jiantou-copy:before {
content: "\e667";
}
/* 按钮样式 */
.clearshop{
width:212rpx;
height:61rpx;
background:rgba(21,39,109,1);
box-shadow:0rpx 0rpx 20rpx 0rpx rgba(4,0,0,0.2);
color:#fff;
font-size: 28rpx;
line-height:61rpx;
text-align: center;
border-top-left-radius: 16rpx;
border-bottom-right-radius: 16rpx;
margin:60rpx auto 0;
}
/* 客服弹层 */
.kefuregister{
width: 100%;
height: 100%;
background-color: rgba(0,0,0,0.5);
position:fixed;
left:0;
right:0;
z-index: 5;
}
.kefuwrap{
width:465rpx;
height:195rpx;
background: #ffffff;
border-radius: 10rpx;
position: absolute;
z-index: 6;
/*left:0.4rem;*/
/*top: 3rem;*/
top:50%;
left:50%;
transform: translate(-50%,-50%);
}
.pohone{
width:300rpx;
margin:65rpx auto;
color:#15276D;
font-size: 36rpx;
text-align: center;
border-bottom:1rpx solid #15276D;
}
.kefucancel{
text-align: center;
position: absolute;
top:112%;
left:0;
right:0;
/* transform: translate(112%,-50%); */
margin:0 auto;
z-index: 999;
color:#fff;
font-size: 60rpx !important;
}
/* 暂无数据 */
.nodata{
color:#999;
font-size: 26rpx;
text-align: center;
margin-top: 20rpx;
}
/* 没有产品的提示 */
.quewrap{
width:465rpx;
height:245rpx;
background: #4c4c4c;
border-radius: 10rpx;
position: absolute;
/*left:0.4rem;*/
/*top: 3rem;*/
top:50%;
left:50%;
transform: translate(-50%,-50%);
/* opacity: 0.8; */
z-index:999;
padding: 20rpx 30rpx;
box-sizing: border-box
}
.tishi{
color:#82a7f5;
font-size: 36rpx;
margin-left:14rpx;
margin-top:15rpx;
}
.product{
margin-left:14rpx;
color:#fff;
font-size: 30rpx;
margin-top:22rpx;
}
\ No newline at end of file
... ...

244.0 KB

{
"navigationBarTitleText": "首页",
"navigationBarTitleText": "壹万商城",
"navigationBarBackgroundColor": "#6EAC3D",
"navigationBarTextStyle": "white"
}
\ No newline at end of file
... ...
<view class='box'>
<view class="beginimg">
<image src="/img/begin.png"></image>
<image src="/img/bac.jpg"></image>
</view>
... ...
... ... @@ -20,9 +20,13 @@ page {
}
.beginimg {
width: 750rpx;
height: 100%;
position: relative
width: 500rpx;
height: 500rpx;
position:absolute;
top:40%;
left:50%;
transform: translate(-50%,-40%)
}
.beginimg image {
... ...
... ... @@ -13,40 +13,40 @@ Page({
detail_id: null,
detailCon: {},
assess: [],
id:'',
id: '',
days: 0,
hours: 0,
minutes: 0,
seconds: 0,
over:true,
short:[],
seemore:true,
images:[]
over: true,
short: [],
seemore: true,
images: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: function(options) {
console.log(options)
this.setData({
detail_id: options.id,
id:options.id
id: options.id
})
this.detaiFun(options.id)
},
slectpic(e){
let that=this;
slectpic(e) {
let that = this;
console.log(e)
let idx=e.currentTarget.dataset.idx;
let idx = e.currentTarget.dataset.idx;
let newassess = that.data.assess;
for (var i = 0; i < newassess.length;i++){
if(i==idx){
that.setData({
images: newassess[i].img
})
}
for (var i = 0; i < newassess.length; i++) {
if (i == idx) {
that.setData({
images: newassess[i].img
})
}
}
... ... @@ -54,7 +54,7 @@ Page({
},
// 图片预览
previewImage: function (e) {
previewImage: function(e) {
let that = this;
console.log(e)
... ... @@ -68,7 +68,7 @@ Page({
}
}
var current = e.target.dataset.src
wx.previewImage({
current: current,
... ... @@ -77,26 +77,26 @@ Page({
},
//已成团
group(){
group() {
wx.showToast({
title: '商品已成团,无法继续购买',
icon:"none"
icon: "none"
})
},
//结束
gameover(){
//结束
gameover() {
wx.showToast({
title: '活动已结束',
icon:"none"
icon: "none"
})
},
moresee(){
moresee() {
let that = this;
that.setData({
seemore:false
seemore: false
})
let url = "home/index/shopMessage";
let header = {
"XX-Token": wx.getStorageSync('token'),
... ... @@ -108,23 +108,51 @@ Page({
app.post(url, params, header).then((res) => {
console.log(res)
let masarr = []
that.setData({
// short: masarr,
//assess: res.data
assess:res.data
assess: res.data
})
}).catch((err) => {
console.log(err)
})
},
goFirm_order1(e) {
wx.navigateTo({
url: '../firm_order1/firm_order1?id=' + e.currentTarget.dataset.id + "&&num=" + this.data.num,
let that = this;
let url = '/user/index/checkNum',
params = {
num: that.data.num,
shop_id: that.data.id
}
let header = {
'XX-Token': wx.getStorageSync("token"),
'XX-Device-Type': 'wxapp'
}
app.post(url, params).then((res) => {
console.log(res);
if (res.msg.msg == "可以购买") {
wx.navigateTo({
url: '../firm_order1/firm_order1?id=' + e.currentTarget.dataset.id + "&&num=" + this.data.num,
})
}else{
wx.showToast({
title: '库存不足',
icon:"none"
})
}
}).catch((err) => {
})
},
// 商品详情数据
... ... @@ -145,7 +173,7 @@ Page({
content: res.content
})
// WxParse.wxParse('content', 'html', this.data.content, this, 5);
WxParse.wxParse('article', 'html', res.data.content, that, 5)
console.log(that.data.detailCon);
... ... @@ -157,7 +185,7 @@ Page({
var totalSecond = number;
console.log(totalSecond)
var interval = setInterval(function () {
var interval = setInterval(function() {
// 秒数
var second = totalSecond;
// 天数位
... ... @@ -176,18 +204,18 @@ Page({
var sec = second - day * 3600 * 24 - hr * 3600 - min * 60;
var secStr = sec.toString();
if (secStr.length == 1) secStr = '0' + secStr;
that.setData({
days: dayStr,
hours: hrStr,
minutes: minStr,
minutes: minStr,
seconds: secStr,
});
totalSecond--;
if (totalSecond <= 0) {
that.setData({
over:false
over: false
})
console.log(that.data.over)
clearInterval(interval);
... ... @@ -205,7 +233,7 @@ Page({
});
}
}.bind(this), 1000);
}).catch((err) => {
console.log(err)
... ... @@ -224,12 +252,12 @@ Page({
}
app.post(url, params, header).then((res) => {
console.log(res)
let masarr=[]
for (var i = 0; i < res.data.length;i++){
if(i<5){
let masarr = []
for (var i = 0; i < res.data.length; i++) {
if (i < 5) {
masarr.push(res.data[i])
}
}
that.setData({
// short: masarr,
... ... @@ -262,19 +290,19 @@ Page({
duration: 1500
})
setTimeout(function(){
setTimeout(function() {
that.detaiFun()
},1500)
}, 1500)
// }
}).catch((err) => {
console.log(err)
wx.showToast({
title: err.msg,
icon:'none'
icon: 'none'
})
setTimeout(function () {
setTimeout(function() {
that.detaiFun()
}, 1500)
})
... ... @@ -283,25 +311,25 @@ Page({
this.setData({
index: e.currentTarget.dataset.id,
})
if (e.currentTarget.dataset.id==2){
if (e.currentTarget.dataset.id == 2) {
console.log(9909)
this.assessFun()
}else{
} else {
this.detaiFun()
}
},
goConfirm: function () {
goConfirm: function() {
this.setData({
showModal: true,
})
},
m_close: function () {
m_close: function() {
this.setData({
showModal: false,
})
},
// 点击加减
bindMinus: function () {
bindMinus: function() {
var num = this.data.num;
if (num > 1) {
num--;
... ... @@ -311,7 +339,7 @@ Page({
});
},
// 点击加
bindPlus: function () {
bindPlus: function() {
var num = this.data.num;
num++;
this.setData({
... ... @@ -321,49 +349,49 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
... ... @@ -9,7 +9,7 @@ Page({
date: '2016-09-01',
time: '12:01',
region: ['请选择', '请选择', '请选择'],
selectregion:"请选择省市区",
selectregion: "请选择省市区",
// customItem: '全部',
status: false,
... ... @@ -23,28 +23,36 @@ Page({
county: '',
address: '',
type: 0,
noorder:'',
noorderid:'',
num:''
noorder: '',
noorderid: '',
num: '',
multiArray: [],
multiIndex: [0, 0, 0],
selectprocname: '请选择省市区',
pro: '',
selprovince: '',
selcity:'',
zone: ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
onLoad: function(options) {
console.log(options)
this.getalladdress()
if (options.id != undefined) {
this.setData({
address_id: options.id,
})
}
if(options.noorder!=undefined){
if (options.noorder != undefined) {
this.setData({
noorder:options.noorder,
noorderid:options.noorderid,
num:options.num
noorder: options.noorder,
noorderid: options.noorderid,
num: options.num
})
}
... ... @@ -57,6 +65,113 @@ Page({
// this.getaddressEdit()
},
// bindMultiPickerChange(e) {
// console.log('picker发送选择改变,携带值为', e.detail.value)
// this.setData({
// multiIndex: e.detail.value
// })
// },
bindMultiPickerColumnChange(e) {
console.log('修改的列为', e.detail.column, ',值为', e.detail.value)
const data = {
multiArray: this.data.multiArray,
multiIndex: this.data.multiIndex
}
data.multiIndex[e.detail.column] = e.detail.value
switch (e.detail.column) {
case 0:
console.log('修改的列为', e.detail.column, ',值为', e.detail.value)
console.log(data.multiIndex)
let newpro = this.data.pro;
let province = newpro;
let city = newpro[e.detail.value].son
let zone = newpro[e.detail.value].son[0].son;
console.log(province);
console.log(city);
console.log(zone)
this.setData({
selprovince: province,
selcity:city,
zone:zone
})
data.multiArray[1] = city
data.multiArray[2] = zone
break
case 1:
console.log(data.multiIndex)
console.log(e.detail.value)
let secnewpro = this.data.pro;
let secity = this.data.selcity;
console.log(secity)
let seczone = secity[e.detail.value].son
data.multiArray[2] = seczone
break
}
this.setData(data)
},
bindMultiPickerChange(e) {
let that = this
console.log(e)
let p=e.detail.value;
console.log(p)
console.log(that.data.multiArray[0][p[0]].name)
that.setData({
multiIndex: [p[0],p[1], p[2]],
selectprocname: that.data.multiArray[0][p[0]].name + that.data.multiArray[1][p[1]].name + that.data.multiArray[2][p[2]].name,
province: that.data.multiArray[0][p[0]].name,
city: that.data.multiArray[1][p[1]].name,
county: that.data.multiArray[2][p[2]].name,
})
console.log(that.data.selectprocname)
},
//获取省市区
getalladdress() {
let that = this;
let url = '/home/index/getAddress',
params = {
token: wx.getStorageSync('token'),
}
app.post(url, params).then((res) => {
console.log(res)
let pro = res.data;
let province = res.data;
let city = res.data[0].son
let zone = res.data[0].son[0].son;
let arr = [];
that.setData({
pro: res.data,
multiArray: [province, city, zone]
})
console.log(that.data.multiArray)
}).catch((err) => {
})
},
// 姓名
enterName(e) {
console.log(e)
... ... @@ -107,7 +222,7 @@ Page({
city: res.data.city,
county: res.data.city,
address: res.data.address,
selectregion:res.data.province+res.data.city+res.data.county
selectprocname: res.data.province + res.data.city + res.data.county
})
... ... @@ -124,7 +239,7 @@ Page({
add_1() {
let that = this;
// 接收信息
let name = that.data.name;
... ... @@ -137,32 +252,32 @@ Page({
// 正则表达式
//let regName = /^[\u4e00-\u9fa5]{0,}$/;
let regPhone = /^[1][3,4,5,6,7,8,9][0-9]{9}$/;
if(name ==''){
if (name == '') {
wx.showToast({
title: '请输入姓名',
icon: 'none'
})
}else if(mobile ==''){
} else if (mobile == '') {
wx.showToast({
title: '请输入手机号',
icon: 'none'
})
}else if(!regPhone.test(mobile)){
} else if (!regPhone.test(mobile)) {
wx.showToast({
title: '请输入正确的手机号',
icon: 'none'
})
} else if (that.data.selectregion =="请选择省市区"){
} else if (that.data.selectprocname == "请选择省市区") {
wx.showToast({
title: '请选择省市区',
icon: 'none'
})
} else if (address==''){
} else if (address == '') {
wx.showToast({
title: '请输入详细地址',
icon: 'none'
})
}else{
} else {
let url = 'user/index/addressPost';
let params = {
... ... @@ -187,29 +302,29 @@ Page({
icon: "none",
duration: 1500
})
console.log(that.data.noorder)
if (that.data.noorder==1){
setTimeout(function () {
console.log(that.data.noorder)
if (that.data.noorder == 1) {
setTimeout(function() {
console.log(that.data.num)
wx.navigateTo({
url: '/pages/kind/firm_order1/firm_order1?num='+that.data.num+'&id='+that.data.noorderid,
url: '/pages/kind/firm_order1/firm_order1?num=' + that.data.num + '&id=' + that.data.noorderid,
})
}, 1000)
}else{
setTimeout(function () {
} else {
setTimeout(function() {
wx.navigateTo({
url: '/pages/mine/addr_1/addr_1',
})
}, 1000)
}
}).catch((err) => {
})
}
},
... ... @@ -234,7 +349,7 @@ Page({
},
// 选择器
bindRegionChange: function (e) {
bindRegionChange: function(e) {
console.log('picker发送选择改变,携带值为', e.detail.value)
let address_1 = e.detail.value
this.setData({
... ... @@ -284,49 +399,49 @@ Page({
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
... ... @@ -10,11 +10,26 @@
</view>
<view class='top_item top_between'>
<view class='top_item_name'>省市/区</view>
<picker mode="region" bindchange="bindRegionChange" value="{{region}}" custom-item="{{customItem}}">
<!-- <picker mode="region" bindchange="bindRegionChange" value="{{region}}" custom-item="{{customItem}}">
<view class="top_item_right">
<!-- <view>{{region[0]}},{{region[1]}},{{region[2]}} </view> -->
<view>{{selectregion}}</view>
<!-- 箭头图片 -->
<view class='top_item_right_pic'>
<image src='../../../img/right_1.png'></image>
</view>
</view>
</picker> -->
<picker mode="multiSelector" bindchange="bindMultiPickerChange" bindcolumnchange="bindMultiPickerColumnChange" value="{{multiIndex}}" range="{{multiArray}}" range-key='name'>
<view class="top_item_right">
<!-- <view>{{multiArray[0][multiIndex[0]]}},{{multiArray[1][multiIndex[1]]}},{{multiArray[2][multiIndex[2]]}}</view> -->
<view>{{selectprocname}}</view>
<view class='top_item_right_pic'>
<image src='../../../img/right_1.png'></image>
</view>
... ...