作者 lihongjuan

团购

正在显示 100 个修改的文件 包含 3901 行增加0 行删除

要显示太多修改。

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

//app.js
App({
onLaunch: function () {
wx.getSystemInfo({
success: res => {
//导航高度
this.globalData.navHeight = res.statusBarHeight + 46;
}, fail(err) {
console.log(err);
}
})
// 展示本地存储能力
var logs = wx.getStorageSync('logs') || []
logs.unshift(Date.now())
wx.setStorageSync('logs', logs)
//自动更新版本
const updateManager = wx.getUpdateManager()
updateManager.onCheckForUpdate(function (res) {
// 请求完新版本信息的回调
})
updateManager.onUpdateReady(function () {
wx.showModal({
title: '更新提示',
content: '新版本已经准备好,是否重启应用?',
success: function (res) {
if (res.confirm) {
// 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
updateManager.applyUpdate()
}
}
})
})
updateManager.onUpdateFailed(function () {
// 新的版本下载失败
wx.showModal({
title: '更新提示',
content: '新版本下载失败',
showCancel: false
})
})
},
post: function (url, data, headerParams, showLoad) {
wx.showNavigationBarLoading()
var promise = new Promise((resolve, reject) => {
//init
let that = this;
let postData = data;
let baseUrl = 'https://ygzyshop.cn/api/';
//网络请求
let header = {
'content-type': 'application/x-www-form-urlencoded'
}
header = Object.assign(header, headerParams)
//网络请求
wx.request({
url: baseUrl + url,
data: postData,
method: 'POST',
header: header,
success: function (res) { //返回取得的数据
if (res.data.code == '20000') {
resolve(res.data);
} else if (res.data.code == '201') {
resolve(res.data);
}
// else if (res.data.code == '10001') {
// wx.showToast({
// title: res.data.msg,
// icon: 'none',
// duration: 1000,
// success: function (res) {
// let t = setInterval(function () {
// clearInterval(t)
// wx.navigateTo({
// url: '/pages/index/index',
// })
// }, 1000)
// }
// })
// }
else {
// wx.showModal({
// title: '提示',
// content: res.data.msg,
// showCancel: false
// })
reject(res.data)
}
setTimeout(function () {
// if (show||show==undefined){
// wx.hideLoading()
// }
wx.hideNavigationBarLoading()
}, 600)
},
fail: function (e) {
reject('网络出错');
// wx.hideLoading()
wx.hideNavigationBarLoading()
}
})
});
return promise;
},
pay(res, successData) {
wx.requestPayment({
"timeStamp": res.pay.timeStamp,
"nonceStr": res.pay.nonceStr,
"package": res.pay.package,
"signType": "MD5",
"paySign": res.pay.paySign,
"success": function (res) {
wx.showToast({
title: '支付完成',
icon: "success",
duration: 1500,
success: function (data) {
successData(data)
}
})
},
"fail": function (res) {
wx.showToast({
title: '取消支付成功!',
icon: "icon",
duration: 1500,
})
}
})
},
// 上传图片
upload(filetype, file) {
var promise = new Promise((resolve, reject) => {
wx.showNavigationBarLoading()
wx.showLoading({
title: '上传中',
})
let url = 'https://ygzyshop.cn/api/user/upload/one';
let head = {
'XX-Token': wx.getStorageSync('token'),
'XX-Device-Type': 'wxapp'
}
let typename = {
filetype: filetype
}
wx.uploadFile({
url: url, //仅为示例,非真实的接口地址
filePath: file,
name: 'file',
header: head,
formData: typename,
success: function (res) {
console.log('上传文件后', res)
let temdata = JSON.parse(res.data);
console.log(temdata)
let urlobj = {
url: temdata.data.url
//url: temdata.data.filepath
}
resolve(urlobj);
wx.hideNavigationBarLoading();
wx.hideLoading();
},
fail: function (res) {
reject('网络出错');
wx.hideNavigationBarLoading()
wx.hideLoading()
},
complete: () => {
wx.hideNavigationBarLoading()
wx.hideLoading()
},
})
});
return promise;
},
nowDate() {
let date = new Date();
let month = date.getMonth() + 1;
let day = date.getDate();
return date.getFullYear() + '-' + (month > 9 ? month : ('0' + month)) + '-' + (day > 9 ? day : ('0' + day));
},
minDate() {
let date = new Date();
date.setDate(date.getDate() - 287);
let m = date.getMonth() + 1;
return date.getFullYear() + '-' + m + '-' + date.getDate();
},
timeFormate(timestamp, timeType) {
var timeStamp = timestamp.length == 13 ? timestamp : timestamp * 1000
var date = new Date(timeStamp); //时间戳为10位需*1000,时间戳为13位的话不需乘1000
var Y = date.getFullYear() + '-';
var M = (date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) + '-';
var D = date.getDate() + ' ';
var h = date.getHours() + ':';
var m = (date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes());
var s = date.getSeconds();
if (timeType == 'YYMMDD') {
return Y + M + D;
} else {
return h + m;
}
},
//接口管理
interface: {
historyDelete:'/home/index/historyDelete',//删除
shopClass:'/home/index/shopClass',//分类
shopPage:'/home/index/shopPage',//分页
history:'/home/index/history',//检索
index: '/home/index/index', //首页
login: '/wxapp/public/login', //小程序登录注册
getSessionKey: '/wxapp/public/getSessionKey', //获取sessionKey和openid
},
//全局变量
globalData: {
userInfo: null,
cid: null,
class_id: null,
navHeight: 0
}
})
\ No newline at end of file
... ...
{
"pages": [
"pages/index/index",
"pages/mine/eOrder/eOrder",
"pages/homeindex/homeindex",
"pages/kind/kind",
"pages/homeindex/search/search",
"pages/mine/mine",
"pages/kind/detail_1/detail_1",
"pages/kind/firm_order2/firm_order2",
"pages/kind/firm_order1/firm_order1",
"pages/kind/success/success",
"pages/mine/contactUs/contactUs",
"pages/mine/myOrder/myOrder",
"pages/mine/addr_2/addr_2",
"pages/mine/addr_1/addr_1",
"pages/logs/logs",
"pages/mine/collect/collect",
"pages/mine/addr_3/addr_3"
],
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "壹万商城",
"navigationBarTextStyle": "black"
},
"tabBar": {
"selectedColor": "#6EAC3D",
"list": [
{
"pagePath": "pages/homeindex/homeindex",
"text": "首页",
"selectedColor": "#6EAC3D",
"iconPath": "img/01_nav@2x.png",
"selectedIconPath": "img/01_nav_fill@2x.png"
},
{
"pagePath": "pages/kind/kind",
"text": "分类",
"selectedColor": "#6EAC3D",
"iconPath": "img/02_nav@2x.png",
"selectedIconPath": "img/02_nav_fill@2x.png"
},
{
"pagePath": "pages/mine/mine",
"text": "我的",
"selectedColor": "#6EAC3D",
"iconPath": "img/03_nav@2x.png",
"selectedIconPath": "img/03_nav_fill@2x.png"
}
]
},
"sitemapLocation": "sitemap.json"
}
\ No newline at end of file
... ...
/**app.wxss**/
/* .container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
} */
@font-face {font-family: "iconfont";
src: url('//at.alicdn.com/t/font_1185528_wr32c54axab.eot?t=1557483201237'); /* IE9 */
src: url('//at.alicdn.com/t/font_1185528_wr32c54axab.eot?t=1557483201237#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('data:application/x-font-woff2;charset=utf-8;base64,d09GMgABAAAAAAO0AAsAAAAAB2wAAANlAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHEIGVgCCcAqCeIJVATYCJAMICwYABCAFhG0HLht5BsguMXZtEDOglrGa6sBqKxf3MTmw4ckjgmqs7NndJwB19eUJA+higVWi0EYRqjcmispHxUUo1q9vUpfKYRyjIIPk9z/LChJOuaxl2NoJeMKxDRDMVXBqmxCiSYlfwRtH1AiJzFwSddq1ml3XiJS6Pp1cW0FbINcAqC3RyNuahymXGyOHDeCgau1/Lqc3xecHymmOjUe9AOOtge6BUUCBFkhgHjeMXdASbxNoNMoFsxmXkgM0FOaiQNzk2EqgkTErDbWhXqit2FnEM1OfnqQvPA0+H/+pRD1JTWY2nL4cWwMifrlWgXKn2uEeQjKdE2wfGcuAQpyvdJ+kHKWXKWtU0yomgW3VBr/c/++JN/vDI4haZnUzGIbia5I40kutTqDA8fuAo0GvS+k9Z6B8Z9h8/Wxofq57fL05o3X6FJNXPfMHV4aYdPt1bO6c8H5npvt92zd75vPzPau3F9duzeXfA/MWU+2ohzp8M/EmNpjR4x5Cu+97BhZtB9y2dNS4+Pz4y8z6eCjLnP3zgD98PT+acc6s8JffJNZMTWdnbqp5v9Aqo2koqP6H3hqVuzZfuM6lgMYe3zk6RemZYc+x0g2e//bjrcLSG1/Eg2naLNfRPXPeHJrXiKNN1fKkoArbqqaZCcKBYc0E5YlLaWXB/w54q5Foeh/wCUtgORHxye/Rvj3vq/oT81Hdcpm9ddkGzwGBjbQu9fY2VRxM3lMqMptnvaHv1RpWAVTjydKP+Y61F76Pcn3+WK2An/8oCFYT6uYF6k/fE/wGSce2oslMXXoeMfIk91NBCSjkPlWmv9P7ofqee86Hej137q0zkkBWbxot5DLUaLISqVXvWNU0WhIP9zfpQiiL0oBFvQBCu3NIWn2DrN0TtJDvoEavn1CrPTI0uhjYiU1m45qWRlAlRTWwqhFy1TIptm1UK6zNQmytuJKkZQGVhwjPxaCnm0c+F4+kiEyxhq9jvSjFEBOZBMaB+5BYLINyIhOiauomoFQe5O6Oq57kVi2TAC0bCKQShdSAqjSCONVkpLDXndIqvD8LwqolVok08KqCeRCCx00OeXLj0QGNV0s78W7lEV4dlheKwiCMkJGA4oATEVtpGUhePU0IqUa5EQxIygVxR51wV7Xb8lrJ2+2BRqYhhdWalRsI1wIAAAAA') format('woff2'),
url('//at.alicdn.com/t/font_1185528_wr32c54axab.woff?t=1557483201237') format('woff'),
url('//at.alicdn.com/t/font_1185528_wr32c54axab.ttf?t=1557483201237') format('truetype'), /* chrome, firefox, opera, Safari, Android, iOS 4.2+ */
url('//at.alicdn.com/t/font_1185528_wr32c54axab.svg?t=1557483201237#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-kefu:before {
content: "\e658";
}
.ping{
display:flex;
justify-content: center
}
.noorder{
width:270rpx;
height:270rpx;
font-size: 0;
margin:0 auto;
}
.noorder image{
width:100%;
height:100%;
}
.noordertitle{
color:#999999;
font-size: 26rpx;
text-align: center;
margin-top:20rpx
}
\ No newline at end of file
... ...
@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

534 字节

631 字节

562 字节

const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
banner: [],
shop_class: [],
middle: '',
shop: [],
num: 1,
showModal: false,
class_id: '',
detailCon: {},
id: '',
keyword:'',
page: 2,
page_type: true
},
//跳转
anxin(){
wx.navigateTo({
url: '/pages/mine/contactUs/contactUs?status='+2,
})
},
youxuan(){
wx.navigateTo({
url: '/pages/mine/contactUs/contactUs?status=' + 3,
})
},
baozhang(){
wx.navigateTo({
url: '/pages/mine/contactUs/contactUs?status=' + 4,
})
},
look_category(e) {
app.globalData.cid = e.currentTarget.dataset.index
app.globalData.class_id = e.currentTarget.dataset.class_id
wx.switchTab({
url: '/pages/kind/kind'
})
this.get_info()
},
// 跳转页面
btn_name() {
wx.navigateTo({
url: '/pages/homeindex/search/search',
})
},
get_info() {
let that = this
let url = app.interface.index;
let header = {
'XX-Device-Type': 'wxapp',
'XX-Token': wx.getStorageSync('token')
}
let params = {
class_id: that.data.class_id
}
app.post(url, params, header).then((res) => {
let newshop=res.data.shop;
for (var obj of newshop ){
obj.over=false
}
that.setData({
banner: res.data.banner,
shop_class: res.data.shop_class,
middle: res.data.middle,
shop: res.data.shop,
now_time: res.data.now_time,
// totalpae: res.last_page
})
that.countDown()
}).catch((errMsg) => {})
},
m_close: function() {
this.setData({
showModal: false,
})
},
// 点击加减
bindMinus: function() {
var num = this.data.num;
if (num > 1) {
num--;
}
this.setData({
num: num,
});
},
// 点击加
bindPlus: function() {
var num = this.data.num;
num++;
this.setData({
num: num,
});
},
shoptail(e) {
let id = e.currentTarget.dataset.shop_id;
wx.navigateTo({
url: '/pages/kind/detail_1/detail_1?id=' + id,
})
},
// 去团购
goFirm_order1(e) {
this.setData({
})
wx.navigateTo({
url: '/pages/kind/firm_order1/firm_order1?id=' + e.currentTarget.dataset.id + "&&num=" + this.data.num,
})
},
timeFormat(param) { //小于10的格式化函数
return param < 10 ? '0' + param : param;
},
//团购倒计时
countDown() {
let that = this
let objs = Object.assign([], that.data.shop)
let now_time = parseInt(new Date().getTime())
for (let obj of objs) {
let end_time = obj.end_time*1000
let open_time = obj.open_time*1000
if (now_time < open_time) {
//活动未开始
} else if (now_time > end_time) {
obj.over=true
//活动结束
} else {
let time = (end_time - now_time) / 1000;
let day = parseInt(time / (60 * 60 * 24));
let hou = parseInt(time % (60 * 60 * 24) / 3600);
let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
obj.day = that.timeFormat(day),
obj.hou = that.timeFormat(hou),
obj.min = that.timeFormat(min),
obj.sec = that.timeFormat(sec)
}
}
that.setData({
shop: objs
})
setTimeout(that.countDown, 1000);
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
let that = this
that.get_info();
},
info() {
let that = this
let url = app.interface.shopPage
let header = {
'XX-Device-Type': 'wxapp',
'XX-Token': wx.getStorageSync('token')
}
let paramer = {
page: that.data.page,
type: 1
}
app.post(url, paramer,header).then((res) => {
if (res.data.shop.length > 0){
wx.showLoading({
title: '加载中',
})
let t = setInterval((red)=>{
wx.hideLoading()
that.setData({
shop: that.data.shop.concat(res.data.shop),
page_type: true
})
},1000)
} else{
that.setData({
page_type: false
})
wx.showToast({
title: '暂无更多数据',
icon: 'none',
duration: 1000
})
}
}).catch((errMsg) => {
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
let that = this
if (app.globalData.cid != null) {
that.setData({
currentTab: app.globalData.cid
})
}
that.get_info()
that.countDown()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
let that=this
if(that.data.page_type == false){
return false
}
let page=that.data.page;
page++;
that.setData({
page:page
})
that.info()
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "壹万商城",
"navigationBarBackgroundColor": "#6EAC3D",
"navigationBarTextStyle": "white"
}
\ No newline at end of file
... ...
<!--pages/homeindex/homeindex.wxml-->
<!-- <text>pages/homeindex/homeindex.wxml</text> -->
<view class="containerbox">
<view class='search'>
<view class='search_inp' bindtap="btn_name">
<!-- <input type='text' bindtap="btn_name" placeholder='请输入商品名称'></input> -->
请输入商品名称
<image src='../../img/search.png'></image>
</view>
<view class='search_txt' bindtap="btn_name">
搜索
</view>
</view>
<view class='banner'>
<swiper indicator-dots="true" indicator-active-color="#fff" style="width:100%;height:100%;">
<swiper-item wx:for='{{banner}}' wx:key="index">
<image style="width: 688rpx;" mode='widthFix' src='{{item.img}}' />
</swiper-item>
</swiper>
<view class='banner_Mask'></view>
</view>
<view class='commodity'>
<!-- <navigator url=''>
</navigator> -->
<view class='jujia' wx:for='{{shop_class}}' wx:key="index" data-class_id="{{item.class_id}}" bindtap='look_category' data-index='{{index}}'>
<image src='{{item.img}}'></image>
<text>{{item.class_name}}</text>
</view>
<view class='fenlei' bindtap='look_category'>
<image src='../../img/fenlei@3x.png'></image>
<text>全部分类</text>
</view>
</view>
<view class='introduce'>
<view class='introduce_list'>
<view class='introduce_item' bindtap="anxin">
<image src='../../img/anquan@3x.png'></image>
<text>安心检测</text>
</view>
<view class='introduce_item' bindtap="youxuan">
<image src='../../img/youxuan@3x.png'></image>
<text>优选源头</text>
</view>
<view class='introduce_item' bindtap="baozhang">
<image src='../../img/baozhang@3x.png'></image>
<text>赔付保障</text>
</view>
</view>
<image src='{{middle}}'></image>
</view>
<view class='container'>
<view class='mid'>
<view class='ware_box' bindtap="shoptail" wx:for='{{shop}}' data-shop_id='{{item.shop_id}}' wx:key="index">
<view class='ware_top'>
<view class='ware_1'>
<image src='{{item.thumb}}'></image>
<view class='ware_1_over' wx:if="{{item.over}}">
已结束
</view>
<block wx:else>
<view class='ware_1_time' wx:if="{{item.percent==100}}">已成团</view>
<view class='ware_1_time' wx:else>
距结束{{item.day}}天{{item.hou}}时{{item.min}}分{{item.sec}}秒
</view>
</block>
</view>
<view class='ware_text'>
<view class='ware_2'>
<text class='ware_2Txt1'>{{item.name}}</text>
<text class='ware_2Txt2'>产地:{{item.origin}}</text>
</view>
<view class='ware_3'>
<progress percent="{{item.percent}}" show-info color="#B5DE96" border-radius="8" font-size="24rpx" stroke-width="16rpx" />
</view>
<view class='ware_4'>
<text>现有{{item.numb}}份,目标{{item.group}}份</text>
</view>
<view class='ware_5'>
<view>
<text class='ware5_t1'>¥{{item.money_sale}}/</text>
<text class='ware5_t2'>{{item.shop_type}}</text>
</view>
<view class='ware5_box'>
<view class='ware5_t3'>{{item.text_table}}</view>
<view class='ware5_t4'>{{item.text_content}}</view>
</view>
<view class='ware_over'wx:if="{{item.over}}">
已结束
</view>
<view wx:else>
<view class='ware_6' wx:if="{{item.percent==100}}">
已成团
</view>
<view class='ware_6' wx:else>
立即参团
</view>
</view>
</view>
</view>
</view>
<view class='ware_bot'>
<view class='ware_bot_tit'>经典推荐</view>
<view class='ware_bot_txt'>{{item.recommend}}</view>
</view>
</view>
</view>
</view>
<view class='Load'>—— {{page_type?'下拉加载更多':'暂无更多数据'}} ——</view>
</view>
<!-- 弹窗 -->
<view class="mask" catchtouchmove="preventTouchMove" wx:if="{{showModal}}"></view>
<!-- 弹出层 -->
<view class="modalDlg" wx:if="{{showModal}}">
<view class='modalDlg_p'>
<view class='m_top'>
<view class='m_topImg'>
<image src='{{shop[index].thumb}}'></image>
</view>
<view class='m_topTxt'>
<view class='m_topTxt1'>
<view class='m_topName'>{{shop[index].name}}</view>
<image bindtap='m_close' src='../../img/cha.png'></image>
</view>
<view class='m_topTxt2'>
<view class='m_topPrice'>¥{{shop[index].money_sale}}</view>
<view class='m_topHelf'>{{shop[index].shop_type}}</view>
</view>
</view>
</view>
<view class='m_number'>
<view class='m_numTxt'>购买数量</view>
<view class='minus_push'>
<view class='minus' bindtap="bindMinus">-</view>
<view class='num' bindchange="bindManual">{{num}}</view>
<view class='push' bindtap="bindPlus">+</view>
</view>
</view>
<button class='m_btn' bindtap='goFirm_order1' data-id="{{shop[index].shop_id}}">确认</button>
</view>
</view>
\ No newline at end of file
... ...
page{
overflow-x:hidden;
padding-bottom: 50rpx;
}
.containerbox{
overflow-x: hidden;
}
.search {
padding: 16rpx 32rpx;
height: 64rpx;
background: #6eac3d;
display: flex;
justify-content: center;
align-content: space-between;
}
.search_inp {
box-sizing: border-box;
width: 570rpx;
height: 64rpx;
border-radius: 32rpx;
display: flex;
align-items: center;
padding-left: 76rpx;
padding-right: 32rpx;
background: #fff;
border: 0;
outline: none;
font-size: 26rpx;
position: relative;
color: #666;
}
.search_inp input {
width: 100%;
}
.search_inp image {
position: absolute;
left: 32rpx;
top: 17rpx;
width: 32rpx;
height: 32rpx;
}
.search_txt {
height: 64rpx;
font-size: 30rpx;
color: #fff;
line-height: 64rpx;
padding-left: 16rpx;
}
.banner {
width: 688rpx;
height: 336rpx;
margin: 0 auto;
margin-top: 48rpx;
position: relative;
border-radius: 8rpx;
}
.swiper {
height: 100%;
position: absolute;
z-index: 99;
}
.swiper-item {
width: 688rpx;
margin: 0 auto;
height: 336rpx;
border-radius: 8rpx;
}
.swiper-item image {
height: auto;
}
.banner_Mask {
width: 656rpx;
height: 336rpx;
background: rgba(181, 222, 150, 1);
box-shadow: 0rpx 6rpx 40rpx rgba(93, 255, 0, 0.44);
opacity: 0.3;
position: absolute;
bottom: 16rpx;
z-index: -1;
left: 16rpx;
border-radius: 8rpx;
}
.commodity {
width: 688rpx;
/* margin: 0 auto; */
padding: 64rpx 32rpx;
display: flex;
justify-content: space-around;
align-items: center;
font-size: 24rpx;
color: #333;
border-bottom: 8px solid rgba(249, 250, 252, 1);
}
.commodity view {
}
.introduce_list {
display: flex;
justify-content: space-around;
align-items: center;
padding: 36rpx 32rpx 48rpx 32rpx;
}
.introduce_list .introduce_item {
display: flex;
justify-content: space-between;
align-items: center;
}
.introduce_list .introduce_item:first-child image {
width: 32rpx;
height: 36rpx;
}
.introduce_list .introduce_item:nth-child(2) image {
width: 36rpx;
height: 31rpx;
}
.introduce_list .introduce_item:nth-child(3) image {
width: 32rpx;
height: 29rpx;
}
.introduce_list .introduce_item text {
font-size: 28rpx;
display: flex;
align-items: center;
margin-left: 16rpx;
}
.introduce image {
width: 668rpx;
height: 208rpx;
display: block;
margin: 0 auto;
}
.commodity .jujia image, .commodity .fenlei image {
width: 112rpx;
height: 112rpx;
margin: 0 auto;
}
.commodity text {
display: flex;
margin-top: 14rpx;
text-align: center;
justify-content: center;
align-items: center;
}
.container {
width: 750rpx;
display: flex;
align-items: center;
flex-flow: column;
}
.mid {
margin-top: 16rpx;
display: flex;
flex-flow: column;
}
.ware_box {
width: 688rpx;
margin: 32rpx auto;
background: #f9fafc;
}
.ware_box:last-child{
margin-bottom: 0;
}
.ware_top {
overflow: hidden;
display: flex;
padding: 32rpx 18rpx 0;
}
.ware_1 {
width: 312rpx;
height: 208rpx;
position: relative;
}
.ware_1 image {
width: 100%;
height: 100%;
}
.ware_1_time {
position: absolute;
bottom: 0;
width: 208rpx;
height: 48rpx;
color: white;
text-align: center;
line-height: 48rpx;
font-size: 17rpx;
background: #fac8c8;
font-family: PingFang SC;
}
.ware_1_over{
position: absolute;
bottom: 0;
width: 208rpx;
height: 48rpx;
color: white;
text-align: center;
line-height: 48rpx;
font-size: 17rpx;
background: #ddd;
font-family: PingFang SC;
}
.ware_text {
margin-left: 14rpx;
width: 100%;
}
.ware_2 {
display: flex;
justify-content: space-between;
align-content: center;
}
.ware_2Txt1 {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 600;
line-height: 44rpx;
color: rgba(51, 51, 51, 1);
}
.ware_2Txt2 {
font-size: 22rpx;
/* margin-left:98rpx; */
font-family: PingFang SC;
font-weight: 400;
line-height: 32rpx;
color: rgba(204, 204, 204, 1);
}
.ware_3 progress {
width: 370rpx;
color: #b5de96;
margin-top: 24rpx;
}
.ware_4 text {
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 400;
line-height: 32rpx;
color: rgba(204, 204, 204, 1);
}
.ware5_t2 {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
width: 70rpx;
display: inline-block;
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 400;
line-height: 19rpx;
margin-left: 4rpx;
color: rgba(204, 204, 204, 1);
}
.ware_5 {
display: flex;
display: -webkit-flex;
justify-content: space-between;
}
.ware5_t1 {
width: 110rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 26rpx;
font-family: DIN 1451 Std Mittelschrift;
font-weight: 400;
color: rgba(255, 0, 0, 1);
}
.ware5_t3 {
width: 104rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 20rpx;
font-family: PingFang SC;
font-weight: 400;
line-height: 30rpx;
color: rgba(51, 51, 51, 1);
}
.ware5_t4 {
font-size: 18rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(153, 153, 153, 1);
}
.ware_6 {
width: 144rpx;
height: 48rpx;
background: rgba(249, 150, 20, 1);
box-shadow: 0px 2rpx 12rpx rgba(255, 145, 0, 0.16);
border-radius: 24rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 400;
text-align: center;
line-height: 48rpx;
color: rgba(255, 255, 255, 1);
}
.ware_over{
width: 144rpx;
height: 48rpx;
background: #999;
box-shadow: 0px 2rpx 12rpx rgba(255, 145, 0, 0.16);
border-radius: 24rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 400;
text-align: center;
line-height: 48rpx;
color: rgba(255, 255, 255, 1);
}
/* .ware_6 view {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 400;
text-align: center;
line-height: 48rpx;
color: rgba(255, 255, 255, 1);
} */
.ware_bot {
width: 670rpx;
height: 80rpx;
margin: auto;
display: flex;
line-height: 80rpx;
margin-top: 32rpx;
background-color: #f1f7f1;
}
.ware_bot_tit {
font-size: 30rpx;
font-weight: bold;
margin-left: 32rpx;
color: rgba(110, 172, 61, 1);
}
.ware_bot_tit:after {
content: "";
margin: 0 38rpx;
border-right: 1px solid #b5de96;
}
.ware_bot_txt {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(153, 153, 153, 1);
}
/* 规格 */
.spec {
width: 100%;
padding: 0 32rpx;
line-height: 80rpx;
display: flex;
height: 80rpx;
margin-top: 8rpx;
background: white;
}
.spec_txt {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(51, 51, 51, 1);
}
.spec_txt2 {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 400;
margin-left: 108rpx;
color: rgba(153, 153, 153, 1);
}
/* 商品详情 */
.ware_detail {
width: 100%;
margin-top: 8rpx;
margin-bottom: 96rpx;
padding-bottom: 66rpx;
background: white;
}
.ware_detail_tit {
width: 688rpx;
margin: auto;
display: flex;
padding: 44rpx 0rpx 42rpx;
justify-content: space-around;
border-bottom: 2rpx solid #f5f5f5;
}
.ware_detail .ware_active {
color: #6eac3d;
font-weight: 600;
}
.ware_active:after {
content: "";
width: 16rpx;
height: 6rpx;
margin: auto;
display: block;
margin-top: 6rpx;
border-radius: 8rpx;
background: rgba(110, 172, 61, 1);
}
.ware_detail_tit view {
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(153, 153, 153, 1);
}
.ware_detailC {
width: 688rpx;
margin: 26rpx auto 0;
}
.ware_detailImg {
width: 688rpx;
height: 470rpx;
}
.ware_detailImg image {
width: 100%;
height: 100%;
}
/* 遮罩层 */
.mask {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
z-index: 9000;
opacity: 0.64;
}
/* 弹出层 */
.modalDlg {
width: 100%;
height: 454rpx;
bottom: 0;
position: fixed;
z-index: 9999;
background-color: #fff;
}
.modalDlg_p {
padding: 0 30rpx;
}
.m_top {
display: flex;
}
.m_topTxt1 {
display: flex;
align-self: center;
justify-content: space-between;
margin-top: 30rpx;
}
.m_topTxt {
width: 100%;
margin-left: 16rpx;
}
.m_topImg {
margin-top: -48rpx;
display: flex;
}
.m_topImg image {
width: 208rpx;
height: 208rpx;
}
.m_topTxt1 image {
width: 32rpx;
height: 32rpx;
}
.m_topName {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 600;
color: rgba(51, 51, 51, 1);
}
.m_topTxt2 {
display: flex;
margin-top: 16rpx;
align-items: center;
}
.m_topPrice {
width: 120rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 28rpx;
font-family: DIN 1451 Std Mittelschrift;
font-weight: 400;
color: #f00;
}
.m_topHelf {
width: 280rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 400;
margin-left: 16rpx;
color: rgba(204, 204, 204, 1);
}
.m_number {
display: flex;
align-items: center;
margin-top: 18rpx;
}
.minus_push {
display: flex;
margin-left: auto;
align-items: center;
}
.m_numTxt {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(153, 153, 153, 1);
}
.minus, .push {
width: 48rpx;
height: 48rpx;
font-size: 40rpx;
text-align: center;
line-height: 48rpx;
border: 2px solid rgba(110, 172, 61, 1);
border-radius: 50%;
}
.minus {
color: #6eac3d;
}
.num {
margin: 0 26rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(110, 172, 61, 1);
}
.push {
color: white;
background: rgba(110, 172, 61, 1);
}
.m_btn {
width: 688rpx;
height: 80rpx;
border: 0;
margin-top: 62rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 600;
color: rgba(255, 255, 255, 1);
background: linear-gradient(170deg, rgba(181, 222, 150, 1) 0%, rgba(169, 209, 33, 1) 100%);
box-shadow: 0rpx 6rpx 40rpx rgba(162, 255, 0, 0.15);
border-radius: 48rpx;
}
.Load{
width: 100%;
text-align: center;
color: #aaa;
font-size: 26rpx;
margin-top: 50rpx;
}
\ No newline at end of file
... ...
// pages/homeindex/search/search.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
recommend: [],
history: [],
keyword: '',
page: '',
type: true,
dis:true
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
let that = this
that.get_info()
},
enter(){
this.setData({
type: true
})
},
bindKeyInput:function(e){
console.log(e.detail.value)
this.setData({
keyword: e.detail.value,
})
},
get_info() {
let that = this
// 接口地址
let url = app.interface.history
let header = {
'XX-Device-Type': 'wxapp',
'XX-Token': wx.getStorageSync('token')
}
app.post(url, {}, header).then((res) => {
console.log(res)
that.setData({
recommend: res.data.recommend,
history: res.data.history
})
that.countDown()
}).catch((errMsg) => {
})
},
exchange(e){
let keyword=this.data.keyword
console.log(e)
this.setData({
keyword: e.currentTarget.dataset.word,
type:true
})
this.secobdsearch()
},
info(event) {
let that = this
that.setData({
type:false
})
if (that.data.keyword == '') {
wx.showToast({
title: '商品名称不能为空',
icon: 'none',
duration: 1000
})
return false
}
// 接口地址
let url = app.interface.shopPage
let header = {
'XX-Device-Type': 'wxapp',
'XX-Token': wx.getStorageSync('token')
}
let keyword = this.data.keyword
app.post(url, {
page: 1,
keyword: keyword
},header).then((res) => {
console.log
that.setData({
shop: res.data.shop,
// type:false,
dis: false,
// keyword: '',
shop: that.data.shop.concat(res.data.shop)
})
that.get_info()
}).catch((errMsg) => {
})
},
//二次搜索
secobdsearch(){
let that=this;
let url = app.interface.shopPage
let header = {
'XX-Device-Type': 'wxapp',
'XX-Token': wx.getStorageSync('token')
}
let keyword = this.data.keyword
app.post(url, {
page: 1,
keyword: keyword
}, header).then((res) => {
console.log
that.setData({
shop: res.data.shop,
// type: false,
dis: false,
// keyword: '',
shop: that.data.shop.concat(res.data.shop)
})
that.get_info()
}).catch((errMsg) => {
})
},
cansle(){
console.log(111)
this.setData({
type:true,
dis: true
})
},
display() {
this.setData({
dis: false
})
},
clear(){
let that =this
wx.showModal({
title: '提示',
content: '确认删除全部历史记录',
success(res) {
if (res.confirm) {
console.log('用户点击确定')
let url = app.interface.historyDelete
let header = {
'XX-Device-Type': 'wxapp',
'XX-Token': wx.getStorageSync('token')
}
app.post(url, {}, header).then((res) => {
that.setData({
history: []
})
console.log(111)
}).catch((errMsg) => {
})
} else if (res.cancel) {
console.log('用户点击取消')
}
}
})
},
timeFormat(param) { //小于10的格式化函数
return param < 10 ? '0' + param : param;
},
shoptail(e) {
let id = e.currentTarget.dataset.shop_id;
wx.navigateTo({
url: '/pages/kind/detail_1/detail_1?id=' + id,
})
},
//团购倒计时
countDown() {
let that = this
let objs = Object.assign([], that.data.shop)
let now_time = parseInt(new Date().getTime())
// console.log(now_time)
for (let obj of objs) {
let end_time = obj.end_time*1000
// console.log(end_time)
let open_time = obj.open_time*1000
if (now_time < open_time) {
// console.log(333)
//活动未开始
} else if (now_time > end_time) {
// console.log(222)
//活动结束
} else {
// console.log(1111)
let time = (end_time - now_time) / 1000;
let day = parseInt(time / (60 * 60 * 24));
let hou = parseInt(time % (60 * 60 * 24) / 3600);
let min = parseInt(time % (60 * 60 * 24) % 3600 / 60);
let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60);
obj.day = that.timeFormat(day),
obj.hou = that.timeFormat(hou),
obj.min = that.timeFormat(min),
obj.sec = that.timeFormat(sec)
// console.log(obj.day, obj.hou, obj.min, obj.sec)
}
}
that.setData({
shop: objs
})
// console.log(that.data.shop)
setTimeout(that.countDown, 1000);
},
timeFormat(param) { //小于10的格式化函数
return param < 10 ? '0' + param : param;
},
add(){
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
this.countDown()
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
let that = this;
let page = that.data.page;
page++;
that.setData({
page: page
})
that.info()
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "",
"navigationBarBackgroundColor": "#6EAC3D",
"navigationBarTextStyle": "white"
}
\ No newline at end of file
... ...
<!--pages/homeindex/search/search.wxml-->
<!-- <text>pages/homeindex/search/search.wxml</text> -->
<view class='search'>
<view class='search_inp'>
<input type='text' placeholder='请输入商品名称' maxlength='12' bindinput='bindKeyInput' value='{{keyword}}' bindfocus="enter"></input>
<image src='../../../img/search.png'></image>
</view>
<view class='search_txt' bindtap='info' wx:if='{{type}}'>
搜索
</view>
<view class='search_txt' bindtap='cansle' wx:else>
取消
</view>
</view>
<view class='Popular' wx:if='{{dis}}'>
<view class='Popular_title'>
<text>热门搜索</text>
<image src='../../../img/zuire@3x.png'></image>
</view>
<view class='Popular_list' >
<view class='Popular_item' bindtap='exchange' data-word='{{recommend[index]}}' wx:for='{{recommend}}' wx:key>
{{recommend[index]}}
</view>
</view>
<view class='History' wx:if='{{history.length > 0}}'>
<view class='History_title'>历史搜索
<image src='../../../img/del.png' bindtap='clear'></image>
</view>
<view class='History_list'>
<view class='History_item' bindtap='exchange' wx:for='{{history}}' wx:key>{{history[index]}}</view>
</view>
</view>
</view>
<view class='container' bindtap='display' wx:else>
<view class='mid'>
<view class='ware_box' wx:for='{{shop}}' bindtap="shoptail" data-shop_id='{{item.shop_id}}' wx:key="index">
<view class='ware_top'>
<view class='ware_1'>
<image src='{{item.thumb}}'></image>
<view class='ware_1_time'>
据结束{{item.day}}天{{item.hou}}时{{item.min}}分{{item.sec}}秒
</view>
</view>
<view class='ware_text'>
<view class='ware_2'>
<text class='ware_2Txt1'>{{item.name}}</text>
<text class='ware_2Txt2'>{{item.origin}}</text>
</view>
<view class='ware_3'>
<progress percent="{{item.percent}}" show-info color="#B5DE96" border-radius="8" font-size="24rpx" stroke-width="16rpx" />
</view>
<view class='ware_4'>
<text>现有{{item.numb}}份,目标{{item.group}}份</text>
</view>
<view class='ware_5'>
<view>
<text class='ware5_t1'>{{item.money_sale}}</text>
<text class='ware5_t2'>{{item.shop_type}}</text>
</view>
<view class='ware5_box'>
<view class='ware5_t3'>{{item.text_table}}</view>
<view class='ware5_t4'>{{item.text_content}}</view>
</view>
<view class='ware_6'>
<view>立即参团</view>
</view>
</view>
</view>
</view>
<view class='ware_bot'>
<view class='ware_bot_tit'>经典推荐</view>
<view class='ware_bot_txt'>{{item.recommend}}</view>
</view>
</view>
</view>
<view class='empty' wx:if="{{shop.length == 0}}">暂无更多结果</view>
</view>
<!-- 弹窗 -->
<view class="mask" catchtouchmove="preventTouchMove" wx:if="{{showModal}}"></view>
<!-- 弹出层 -->
<view class="modalDlg" wx:if="{{showModal}}">
<view class='modalDlg_p'>
<view class='m_top'>
<view class='m_topImg'>
<image src='{{shop[index].thumb}}'></image>
</view>
<view class='m_topTxt'>
<view class='m_topTxt1'>
<view class='m_topName'>{{shop[index].name}}</view>
<image bindtap='m_close' src='../../img/cha.png'></image>
</view>
<view class='m_topTxt2'>
<view class='m_topPrice'>¥{{shop[index].money_sale}}</view>
<view class='m_topHelf'>{{shop[index].shop_type}}</view>
</view>
</view>
</view>
<view class='m_number'>
<view class='m_numTxt'>购买数量</view>
<view class='minus_push'>
<view class='minus' bindtap="bindMinus">-</view>
<view class='num' bindchange="bindManual">{{num}}</view>
<view class='push' bindtap="bindPlus">+</view>
</view>
</view>
<button class='m_btn' bindtap='goFirm_order1' data-id="{{shop[index].shop_id}}">确认</button>
</view>
</view>
\ No newline at end of file
... ...
/* pages/homeindex/search/search.wxss */
.search{
padding: 16rpx 32rpx;
height: 64rpx;
background: #6EAC3D;
display: flex;
justify-content: center;
align-content: space-between;
}
.search_inp{
box-sizing: border-box;
width: 570rpx;
height: 64rpx;
border-radius: 32rpx;
display:flex;
align-items: center;
padding-left: 76rpx;
padding-right: 32rpx;
background:#fff;
border: 0;
outline: none;
font-size: 26rpx;
position: relative;
}
.search_inp input{
width: 100%;
}
.search_inp image{
position: absolute;
left: 32rpx;
width: 32rpx;
height: 32rpx;
}
.search_txt{
height: 64rpx;
font-size: 30rpx;
color: #fff;
line-height: 64rpx;
padding-left: 16rpx;
}
.Popular{
padding: 32rpx;
padding-bottom: 0rpx;
}
.Popular_title{
display: flex;
align-items: center;
font-size: 26rpx;
color: #333;
font-weight: 400;
}
.Popular_title text{
margin-right: 12rpx;
}
.Popular image{
width: 28rpx;
height: 32rpx;
}
.Popular_list{
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
align-items: center;
margin-top: 28rpx;
padding-bottom: 16rpx;
border-bottom: 1rpx solid #F5F5F5;
}
.Popular_item,.History_item{
padding: 8rpx 26rpx;
border-radius: 24rpx;
background:rgba(247,247,247,1);
font-size: 26rpx;
margin-bottom: 16rpx;
margin-right: 16rpx;
}
.History{
margin-top: 30rpx;
}
.History_title{
font-size: 26rpx;
display: flex;
justify-content: space-between;
align-items: center;
color: #333;
font-weight: 400;
padding-bottom: 28rpx;
}
.History_title img{
width: 32rpx;
height: 32rpx;
}
.History_list{
display: flex;
justify-content: flex-start;
flex-wrap: wrap;
align-items: center;
}
.container{
width: 750rpx;
display: flex;
align-items: center;
flex-flow: column;
}
.mid{
margin-top: 16rpx;
display: flex;
flex-flow: column;
}
.ware_box{
width:688rpx;
height:400rpx;
margin:32rpx auto;
background:#F9FAFC;
}
.ware_top{
overflow: hidden;
display: flex;
padding:32rpx 18rpx 0;
}
.ware_1{
width:312rpx;
height:208rpx;
position: relative;
}
.ware_1 image{
width:100%;
height:100%;
}
.ware_1_time{
position: absolute;
bottom:0;
width:208rpx;
height:48rpx;
color: white;
text-align: center;
line-height:48rpx;
font-size:18rpx;
background:#FAC8C8;
font-family:PingFang SC;
}
.ware_text{
margin-left:14rpx;
width:100%;
}
.ware_2{
display: flex;
justify-content: space-between;
align-content: center;
}
.ware_2Txt1{
font-size:32rpx;
font-family:PingFang SC;
font-weight:600;
line-height:44rpx;
color:rgba(51,51,51,1);
}
.ware_2Txt2{
font-size:22rpx;
/* margin-left:98rpx; */
font-family:PingFang SC;
font-weight:400;
line-height:32rpx;
color:rgba(204,204,204,1);
}
.ware_3 progress{
width:370rpx;
color:#B5DE96;
margin-top:24rpx;
}
.ware_4 text,.ware5_t2{
font-size:18rpx;
font-family:PingFang SC;
font-weight:400;
line-height:32rpx;
color:rgba(204,204,204,1);
}
.ware_5{
display: flex;
display: -webkit-flex;
justify-content: space-between;
}
.ware5_t1{
font-size:30rpx;
font-family:DIN 1451 Std Mittelschrift;
font-weight:400;
color:rgba(255,0,0,1);
}
.ware5_t3{
font-size:22rpx;
font-family:PingFang SC;
font-weight:400;
line-height:30rpx;
color:rgba(51,51,51,1);
}
.ware5_t4{
font-size:18rpx;
font-family:PingFang SC;
font-weight:400;
color:rgba(153,153,153,1);
}
.ware_6{
width:144rpx;
height:48rpx;
background:rgba(249,150,20,1);
box-shadow:0px 2rpx 12rpx rgba(255,145,0,0.16);
border-radius:24rpx;
}
.ware_6 view{
font-size:26rpx;
font-family:PingFang SC;
font-weight:400;
text-align: center;
line-height:48rpx;
color:rgba(255,255,255,1);
}
.ware_bot{
width:670rpx;
height:80rpx;
margin: auto;
display: flex;
line-height:80rpx;
margin-top:32rpx;
background-color:#F1F7F1;
}
.ware_bot_tit{
font-size:30rpx;
font-weight:bold;
margin-left:32rpx;
color:rgba(110,172,61,1);
}
.ware_bot_tit:after{
content:"";
margin:0 38rpx;
border-right:1px solid #B5DE96;
}
.ware_bot_txt{
font-size:24rpx;
font-family:PingFang SC;
font-weight:400;
color:rgba(153,153,153,1);
}
/* 规格 */
.spec{
width:100%;
padding:0 32rpx;
line-height:80rpx;
display: flex;
height:80rpx;
margin-top:8rpx;
background:white;
}
.spec_txt{
font-size:32rpx;
font-family:PingFang SC;
font-weight:400;
color:rgba(51,51,51,1);
}
.spec_txt2{
font-size:24rpx;
font-family:PingFang SC;
font-weight:400;
margin-left:108rpx;
color:rgba(153,153,153,1);
}
/* 商品详情 */
.ware_detail{
width:100%;
margin-top:8rpx;
margin-bottom:96rpx;
padding-bottom:66rpx;
background: white;
}
.ware_detail_tit{
width:688rpx;
margin: auto;
display: flex;
padding:44rpx 0rpx 42rpx;
justify-content:space-around;
border-bottom:2rpx solid #F5F5F5;
}
.ware_detail .ware_active{
color:#6EAC3D;
font-weight:600;
}
.ware_active:after{
content: "";
width:16rpx;
height: 6rpx;
margin: auto;
display: block;
margin-top:6rpx;
border-radius:8rpx;
background:rgba(110,172,61,1);
}
.ware_detail_tit view{
font-size:28rpx;
font-family:PingFang SC;
font-weight:400;
color:rgba(153,153,153,1);
}
.ware_detailC{
width:688rpx;
margin:26rpx auto 0;
}
.ware_detailImg{
width:688rpx;
height:470rpx;
}
.ware_detailImg image{
width:100%;
height:100%;
}
.empty{
font-size: 32rpx;
margin-top: 120px;
text-align: center;
color: #ccc;
}
/* 弹出层 */
.modalDlg {
width: 100%;
height: 454rpx;
bottom: 0;
position: fixed;
z-index: 9999;
background-color: #fff;
}
.modalDlg_p {
padding: 0 30rpx;
}
.m_top {
display: flex;
}
.m_topTxt1 {
display: flex;
align-self: center;
justify-content: space-between;
margin-top: 30rpx;
}
.m_topTxt {
width: 100%;
margin-left: 16rpx;
}
.m_topImg {
margin-top: -48rpx;
display: flex;
}
.m_topImg image {
width: 208rpx;
height: 208rpx;
}
.m_topTxt1 image {
width: 32rpx;
height: 32rpx;
}
.m_topName {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 600;
color: rgba(51, 51, 51, 1);
}
.m_topTxt2 {
display: flex;
margin-top: 16rpx;
align-items: center;
}
.m_topPrice {
width: 120rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 28rpx;
font-family: DIN 1451 Std Mittelschrift;
font-weight: 400;
color: #f00;
}
.m_topHelf {
width: 280rpx;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 400;
margin-left: 16rpx;
color: rgba(204, 204, 204, 1);
}
.m_number {
display: flex;
align-items: center;
margin-top: 18rpx;
}
.minus_push {
display: flex;
margin-left: auto;
align-items: center;
}
.m_numTxt {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(153, 153, 153, 1);
}
.minus, .push {
width: 48rpx;
height: 48rpx;
font-size: 40rpx;
text-align: center;
line-height: 48rpx;
border: 2px solid rgba(110, 172, 61, 1);
border-radius: 50%;
}
.minus {
color: #6eac3d;
}
.num {
margin: 0 26rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(110, 172, 61, 1);
}
.push {
color: white;
background: rgba(110, 172, 61, 1);
}
.m_btn {
width: 688rpx;
height: 80rpx;
border: 0;
margin-top: 62rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 600;
color: rgba(255, 255, 255, 1);
background: linear-gradient(170deg, rgba(181, 222, 150, 1) 0%, rgba(169, 209, 33, 1) 100%);
box-shadow: 0rpx 6rpx 40rpx rgba(162, 255, 0, 0.15);
border-radius: 48rpx;
}
.ware_box:last-child{
margin-bottom: 0;
}
\ No newline at end of file
... ...
//index.js
//获取应用实例
const app = getApp()
Page({
data: {
},
getOpenId() {
let that = this
wx.login({
success: (res) => {
let url = 'wxapp/public/getSessionKey'
let param = {
code: res.code,
}
app.post(url, param).then((res) => {
that.setData({
openid: res.data.openid,
session_key: res.data.session_key
})
wx.getSetting({
success: res => {
if (res.authSetting['scope.userInfo'] === true) {
wx.getUserInfo({
success: reg => {
that.setData({
encrypted_data: reg.encryptedData,
iv: reg.iv
})
that.login()
}
})
}
}
})
}).catch((errMsg) => {})
}
});
},
// 获取用户权限信息
getUserInfo(e) {
let that = this;
if (e.detail.errMsg == "getUserInfo:ok") {
that.setData({
encrypted_data: e.detail.encryptedData,
iv: e.detail.iv
})
that.login()
}
},
// 登录
login() {
let that = this;
let url = "wxapp/public/login";
let data = {
openid: that.data.openid,
session_key: that.data.session_key,
encrypted_data: that.data.encrypted_data,
iv: that.data.iv,
}
app.post(url, data).then((res) => {
wx.setStorageSync("token", res.data.token);
wx.showLoading({
title: '正在进入',
})
let t = setInterval(function() {
clearInterval(t)
wx.switchTab({
url: '../homeindex/homeindex',
})
wx.hideLoading()
}, 1500)
}).catch((err) => {
})
// }).catch((errMsg) => { })
},
// 111
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
this.getOpenId();
},
})
\ No newline at end of file
... ...
{
"usingComponents": {}
}
\ No newline at end of file
... ...
<view class='box'>
<view class="beginimg">
<image src="/img/bac.jpg"></image>
</view>
<!-- <view class='go'> -->
<button open-type='getUserInfo' bindgetuserinfo="getUserInfo" class="qidong">立即启动</button>
<!-- </view> -->
</view>
\ No newline at end of file
... ...
/**index.wxss**/
page {
height: 100%;
width: 750rpx;
position: relative;
}
.box {
height: 100%;
position: relative
}
.cover {
position: relative;
height: 100vh;
overflow: hidden;
box-sizing: border-box;
padding-top: 200rpx;
}
.beginimg {
width: 500rpx;
height: 500rpx;
position:absolute;
top:40%;
left:50%;
transform: translate(-50%,-40%)
}
.beginimg image {
width: 100%;
height: 100%;
}
.cover image {
display: block;
width: 300rpx;
height: 300rpx;
margin: 0 auto;
}
.cover text {
display: block;
width: 500rpx;
margin: 0 auto;
text-align: center;
}
.go {
position: absolute;
bottom:134rpx;
left: 0;
right: 0;
margin: auto;
width:425rpx;
height:88rpx;
background:rgba(118,208,82,1);
box-shadow:0rpx 16rpx 30rpx 0rpx rgba(138,202,103,0.6);
border-radius:44rpx;
/* border:1rpx solid #434343; */
}
.qidong{
position: absolute;
bottom:134rpx;
left: 0;
right: 0;
margin: auto;
width:425rpx;
height:88rpx;
background:rgba(118,208,82,1);
box-shadow:0px 16rpx 30rpx 0rpx rgba(138,202,103,0.6);
border-radius:44rpx;
font-size: 30rpx;
color: #fff;
text-align: center;
line-height: 88rpx;
}
button::after{
border:none;
outline:none;
}
... ...
// pages/kind/detail_1/detail_1.js
const app = getApp();
var WxParse = require('../../../wxParse/wxParse.js');
Page({
/**
* 页面的初始数据
*/
data: {
index: 1,
showModal: false,
hide: false,
num: 1,
detail_id: null,
detailCon: {},
assess: [],
id: '',
days: 0,
hours: 0,
minutes: 0,
seconds: 0,
over: true,
short: [],
seemore: true,
images: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function(options) {
console.log(options)
this.setData({
detail_id: options.id,
id: options.id
})
this.detaiFun(options.id)
},
slectpic(e) {
let that = this;
console.log(e)
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
})
}
}
console.log(that.data.images)
},
// 图片预览
previewImage: function(e) {
let that = this;
console.log(e)
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
})
}
}
var current = e.target.dataset.src
wx.previewImage({
current: current,
urls: this.data.images
})
},
//已成团
group() {
wx.showToast({
title: '商品已成团,无法继续购买',
icon: "none"
})
},
//结束
gameover() {
wx.showToast({
title: '活动已结束',
icon: "none"
})
},
moresee() {
let that = this;
that.setData({
seemore: false
})
let url = "home/index/shopMessage";
let header = {
"XX-Token": wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
}
let params = {
shop_id: that.data.detail_id,
}
app.post(url, params, header).then((res) => {
console.log(res)
let masarr = []
that.setData({
// short: masarr,
//assess: res.data
assess: res.data
})
}).catch((err) => {
console.log(err)
})
},
goFirm_order1(e) {
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) => {
})
},
// 商品详情数据
detaiFun(id) {
let that = this;
let url = "home/index/shopEdit";
let params = {
shop_id: that.data.id
}
let header = {
"XX-Token": wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
}
app.post(url, params, header).then((res) => {
console.log(res.data.content)
that.setData({
detailCon: res.data,
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);
let number = res.data.end_time - res.data.now_time;
console.log(number)
// let number = res.over_time;
// 时间戳处理
var totalSecond = number;
console.log(totalSecond)
var interval = setInterval(function() {
// 秒数
var second = totalSecond;
// 天数位
var day = Math.floor(second / 3600 / 24);
var dayStr = day.toString();
if (dayStr.length == 1) dayStr = '0' + dayStr;
// 小时位
var hr = Math.floor((second - day * 3600 * 24) / 3600);
var hrStr = hr.toString();
if (hrStr.length == 1) hrStr = '0' + hrStr;
// 分钟位
var min = Math.floor((second - day * 3600 * 24 - hr * 3600) / 60);
var minStr = min.toString();
if (minStr.length == 1) minStr = '0' + minStr;
// 秒位
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,
seconds: secStr,
});
totalSecond--;
if (totalSecond <= 0) {
that.setData({
over: false
})
console.log(that.data.over)
clearInterval(interval);
// wx.showToast({
// title: '已结束',
// icon: 'none'
// });
// 倒计时结束
//that.countDown();
that.setData({
days: '00',
hours: '00',
minutes: '00',
seconds: '00',
});
}
}.bind(this), 1000);
}).catch((err) => {
console.log(err)
})
},
// 商品评价页面
assessFun() {
let that = this;
let url = "home/index/shopMessage";
let header = {
"XX-Token": wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
}
let params = {
shop_id: that.data.detail_id,
}
app.post(url, params, header).then((res) => {
console.log(res)
let masarr = []
for (var i = 0; i < res.data.length; i++) {
if (i < 5) {
masarr.push(res.data[i])
}
}
that.setData({
// short: masarr,
//assess: res.data
assess: masarr
})
console.log(that.data.assess)
}).catch((err) => {
console.log(err)
})
},
// 加入收藏
addFun() {
let that = this;
let url = "home/index/shopCollect";
let params = {
shop_id: that.data.detail_id,
};
let header = {
"XX-Token": wx.getStorageSync('token'),
"XX-Device-Type": 'wxapp'
};
app.post(url, params, header).then((res) => {
console.log(res)
// if(res.code == 20000){
wx.showToast({
title: '收藏成功',
icon: "none",
duration: 1500
})
setTimeout(function() {
that.detaiFun()
}, 1500)
// }
}).catch((err) => {
console.log(err)
wx.showToast({
title: err.msg,
icon: 'none'
})
setTimeout(function() {
that.detaiFun()
}, 1500)
})
},
goy(e) {
this.setData({
index: e.currentTarget.dataset.id,
})
if (e.currentTarget.dataset.id == 2) {
console.log(9909)
this.assessFun()
} else {
this.detaiFun()
}
},
goConfirm: function() {
this.setData({
showModal: true,
})
},
m_close: function() {
this.setData({
showModal: false,
})
},
// 点击加减
bindMinus: function() {
var num = this.data.num;
if (num > 1) {
num--;
}
this.setData({
num: num,
});
},
// 点击加
bindPlus: function() {
var num = this.data.num;
num++;
this.setData({
num: num,
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function() {
}
})
\ No newline at end of file
... ...
{
"navigationBarTitleText": "商品详情",
"navigationBarBackgroundColor": "#6EAC3D",
"navigationBarTextStyle": "white"
}
\ No newline at end of file
... ...
<!--pages/kind/detail_1/detail_1.wxml-->
<!-- 商品 -->
<view class="pagecontainer">
<import src="../../../wxParse/wxParse.wxml" />
<view class='container'>
<view class='ware_box'>
<view class='ware_top'>
<view class='ware_1'>
<image src='{{detailCon.thumb}}'></image>
<view wx:if="{{over}}">
<view class='ware_1_time' wx:if="{{detailCon.percent!=100}}">
{{days}}天{{hours}}小时{{minutes}}分{{seconds}}秒
</view>
<view class='ware_1_time' wx:else>已成团</view>
</view>
<view class='ware_1_over' wx:else>
<!-- {{detailCon.open_time}} -->
已结束
</view>
</view>
<view class='ware_text'>
<view class='ware_2'>
<text class='ware_2Txt1'>{{detailCon.name}}</text>
<text class='ware_2Txt2'>产地:{{detailCon.origin}}</text>
</view>
<view class='ware_3'>
<progress percent="{{detailCon.percent}}" show-info color="#B5DE96" border-radius="8" font-size="24rpx" stroke-width="16rpx" />
</view>
<view class='ware_4'>
<text>已拼{{detailCon.numb}}份,目标{{detailCon.group}}份</text>
</view>
<view class='ware_5'>
<view>
<text class='ware5_t1'>¥{{detailCon.money_sale}}/</text>
<text class='ware5_t2'>{{detailCon.shop_type}}</text>
</view>
<view class='ware5_box'>
<view class='ware5_t3'>{{detailCon.text_table}}</view>
<view class='ware5_t4'>{{detailCon.text_content}}</view>
</view>
<view wx:if="{{over}}">
<view class='ware_6' bindtap='goConfirm' wx:if="{{detailCon.percent!=100}}">
立即参团
</view>
<view class='ware_6' wx:else>已成团</view>
</view>
<view class="waretext" wx:else>活动结束</view>
</view>
</view>
</view>
<view class='ware_bot'>
<view class='ware_bot_tit'>经典推荐</view>
<view class='ware_bot_txt'>{{detailCon.recommend}}</view>
</view>
</view>
</view>
<!-- 商品规格 -->
<view class='spec'>
<view class='spec_txt'>商品规格</view>
<view class='spec_txt2'>{{detailCon.shop_type1}}</view>
</view>
<!-- 商品详情 -->
<view class='ware_detail'>
<view class='ware_detail_tit'>
<view class="ware_detail_box {{index == 1 ? 'ware_active' : ''}}" bindtap='goy' data-id="1">商品详情</view>
<view class="ware_detail_box {{index == 2 ? 'ware_active' : ''}}" bindtap='goy' data-id="2">用户评价</view>
</view>
<view class='ware_detailC'>
<view class='ware_detailImg' wx:if="{{index == 1}}">
<!-- <template is="wxParse" data="{{wxParseData:content.nodes}}" /> -->
<template is="wxParse" data="{{wxParseData:article.nodes}}" />
</view>
<!-- 用户评价 -->
<view class='ware_assess' wx:if="{{index == 2}}">
<view class="noping" wx:if="{{assess.length==0}}">
<view class="noorder">
<image src="/img/noorder.png" mode="widthFix"></image>
</view>
<view class="noordertitle">暂无评价</view>
</view>
<view wx:else>
<!-- <block wx:if="{{seemore}}">
<view class='ware_assess_li 345' wx:for="{{short}}" wx:key="index">
<view class='assess_header'>
<view class='assess_headerImg'>
<image src='{{item.avatar}}'></image>
</view>
<view class='assess_headerTxt'>{{item.user_nickname}}</view>
</view>
<view class='assess_say'>
{{item.text}}
</view>
<block wx:if="{{item.img.length!=0}}">
<view class='ware_pic'>
<view class='ware_picBox' wx:for="{{item.img}}" wx:key=''>
<image src='{{item}}'></image>
</view>
</view>
</block>
<view class='assess_time'>2019/07/01</view>
</view>
</block> -->
<block>
<view class='ware_assess_li 123' wx:for="{{assess}}" wx:key="index" wx:for-item="items" wx:for-index="indexs">
<view class='assess_header'>
<view class='assess_headerImg'>
<image src='{{items.avatar}}'></image>
</view>
<view class='assess_headerTxt'>{{items.user_nickname}}</view>
</view>
<view class='assess_say'>
{{items.text}}
</view>
<block wx:if="{{item.img.length!=0}}">
<view class='ware_pic' >
<view class='ware_picBox' wx:for="{{items.img}}" wx:key=''>
<image src='{{item}}' bindtap="previewImage" data-src="{{item}}" data-idx="{{indexs}}"></image>
</view>
</view>
</block>
<view class='assess_time'>{{items.create_time}}</view>
</view>
</block>
<block wx:if="{{assess.length==5}}">
<view class='whole' wx:if="{{seemore}}" bindtap="moresee">
查看全部评价
</view>
</block>
</view>
</view>
</view>
</view>
<!-- footer底部 -->
<view class='footer'>
<view class="kefu">
<view class="iconfont icon-kefu"></view>
<button class="remaindetail" open-type="contact" style="margin-left: 0"></button>
</view>
<view class='footer_add' bindtap='addFun' wx:if="{{detailCon.collect_type==0}}">加入收藏</view>
<view class='footer_add' bindtap='addFun' wx:if="{{detailCon.collect_type==1}}">取消收藏</view>
<view wx:if="{{over}}">
<view class='footer_off' bindtap='goConfirm' wx:if='{{detailCon.percent!=100}}'>立即参团</view>
<view class='footer_off' wx:else bindtap='group'>已成团</view>
</view>
<view class='footer_over' wx:else bindtap="gameover">活动结束</view>
</view>
<!-- 遮罩层 -->
<view class="mask" catchtouchmove="preventTouchMove" wx:if="{{showModal}}"></view>
<!-- 弹出层 -->
<view class="modalDlg" wx:if="{{showModal}}">
<view class='modalDlg_p'>
<view class='m_top'>
<view class='m_topImg'>
<image src='{{detailCon.thumb}}'></image>
</view>
<view class='m_topTxt'>
<view class='m_topTxt1'>
<view class='m_topName'>{{detailCon.name}}</view>
<image bindtap='m_close' src='../../../img/cha.png'></image>
</view>
<view class='m_topTxt2'>
<view class='m_topPrice'>¥{{detailCon.money_sale}}</view>
<view class='m_topHelf'>{{detailCon.shop_type}}</view>
</view>
</view>
</view>
<view class='m_number'>
<view class='m_numTxt'>购买数量</view>
<view class='minus_push'>
<view class='minus' bindtap="bindMinus">-</view>
<view class='num' bindchange="bindManual">{{num}}</view>
<view class='push' bindtap="bindPlus">+</view>
</view>
</view>
<button class='m_btn' bindtap='goFirm_order1' data-id="{{detailCon.shop_id}}">确认</button>
</view>
</view>
</view>
\ No newline at end of file
... ...
/* pages/kind/detail_1/detail_1.wxss */
@import "../../../wxParse/wxParse.wxss";
page {
background: #f7f7f7;
overflow-x: hidden
}
.pagecontainer{
overflow-x: hidden
}
.container {
overflow: hidden;
background: white;
padding-bottom: 48rpx;
}
.ware_box {
width: 688rpx;
height: 400rpx;
overflow: hidden;
margin:16rpx auto 0;
background: #f9fafc;
}
.ware_top {
margin-top:44rpx;
display: flex;
padding:0 16rpx;
box-sizing: border-box;
}
.ware_1 {
width: 208rpx;
height: 208rpx;
position: relative;
}
.ware_1 image {
width: 100%;
height: 100%;
}
.ware_1_time {
position: absolute;
bottom: 0;
width: 208rpx;
height: 48rpx;
color: white;
text-align: center;
line-height: 48rpx;
font-size: 20rpx;
background: #fac8c8;
font-family: PingFang SC;
}
.ware_1_over{
position: absolute;
bottom: 0;
width: 208rpx;
height: 48rpx;
color: white;
text-align: center;
line-height: 48rpx;
font-size: 20rpx;
background: #ddd;
font-family: PingFang SC;
}
.ware_text {
margin-left:14rpx;
}
.ware_2Txt1 {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 600;
line-height: 44rpx;
color: rgba(51, 51, 51, 1);
}
.ware_2Txt2 {
font-size: 22rpx;
margin-left: 98rpx;
font-family: PingFang SC;
font-weight: 400;
line-height: 32rpx;
color: rgba(204, 204, 204, 1);
}
.ware_3 progress {
width: 370rpx;
color: #b5de96;
margin-top: 24rpx;
}
.ware_4 text{
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 400;
line-height: 32rpx;
color: rgba(204, 204, 204, 1);
}
.ware5_t2 {
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
width:70rpx;
/* display: inline-block; */
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 400;
line-height: 19rpx;
margin-left:4rpx;
color: rgba(204, 204, 204, 1);
}
.ware_5 {
display: flex;
display: -webkit-flex;
justify-content: space-between;
}
.ware5_t1 {
width:110rpx;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
font-size:26rpx;
font-family: DIN 1451 Std Mittelschrift;
font-weight: 400;
color: rgba(255, 0, 0, 1);
}
.ware5_t3 {
width:104rpx;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
font-size: 20rpx;
font-family: PingFang SC;
font-weight: 400;
line-height: 30rpx;
color: rgba(51, 51, 51, 1);
}
.ware5_t4 {
width:104rpx;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
font-size: 18rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(153, 153, 153, 1);
}
.ware_6 {
width: 144rpx;
height: 48rpx;
margin-left: 14rpx;
background: rgba(249, 150, 20, 1);
box-shadow: 0px 2rpx 12rpx rgba(255, 145, 0, 0.16);
border-radius: 24rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 400;
text-align: center;
line-height: 48rpx;
color: rgba(255, 255, 255, 1);
}
.waretext{
width: 144rpx;
height: 48rpx;
margin-left: 14rpx;
background: #999;
box-shadow: 0px 2rpx 12rpx rgba(255, 145, 0, 0.16);
border-radius: 24rpx;
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 400;
text-align: center;
line-height: 48rpx;
color: rgba(255, 255, 255, 1);
}
.ware5_box{
margin-left:4rpx;
}
.ware_6 view {
font-size: 26rpx;
font-family: PingFang SC;
font-weight: 400;
text-align: center;
line-height: 48rpx;
color: rgba(255, 255, 255, 1);
}
.ware_bot {
width: 670rpx;
height: 80rpx;
margin: auto;
display: flex;
line-height: 80rpx;
margin-top: 32rpx;
background-color: #f1f7f1;
}
.ware_bot_tit {
font-size: 30rpx;
font-weight: bold;
margin-left: 32rpx;
color: rgba(110, 172, 61, 1);
}
.ware_bot_tit:after {
content: "";
margin: 0 38rpx;
border-right: 1px solid #b5de96;
}
.ware_bot_txt {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(153, 153, 153, 1);
}
/* 规格 */
.spec {
width: 100%;
padding: 0 32rpx;
line-height: 80rpx;
display: flex;
height: 80rpx;
margin-top: 8rpx;
background: white;
}
.spec_txt {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(51, 51, 51, 1);
}
.spec_txt2 {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 400;
margin-left: 108rpx;
color: rgba(153, 153, 153, 1);
}
/* 商品详情 */
.ware_detail {
width: 100%;
margin-top: 8rpx;
margin-bottom: 96rpx;
padding-bottom: 66rpx;
background: white;
}
.ware_detail_tit {
width: 688rpx;
margin: auto;
display: flex;
padding: 44rpx 0rpx 42rpx;
justify-content: space-around;
border-bottom: 2rpx solid #f5f5f5;
}
.ware_detail .ware_active {
color: #6eac3d;
font-weight: 600;
}
.ware_active:after {
content: "";
width: 16rpx;
height: 6rpx;
margin: auto;
display: block;
margin-top: 6rpx;
border-radius: 8rpx;
background: rgba(110, 172, 61, 1);
}
.ware_detail_tit view {
font-size: 28rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(153, 153, 153, 1);
}
.ware_detailC {
width: 688rpx;
margin: 26rpx auto 0;
}
.ware_detailImg {
width: 688rpx;
height: 470rpx;
padding-bottom: 130rpx;
}
.ware_detailImg image {
width: 100%;
height: 100%;
}
/* 用户评价 */
.ware_assess_li {
padding-bottom: 24rpx;
margin-bottom: 32rpx;
border-bottom: 1px solid #f5f5f5;
}
.assess_header {
display: flex;
justify-content: space-between;
}
.assess_headerImg {
width: 64rpx;
height: 64rpx;
}
.assess_headerImg image {
width: 100%;
height: 100%;
}
.assess_headerTxt {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(153, 153, 153, 1);
}
.assess_say {
font-size: 30rpx;
font-family: PingFang SC;
font-weight: 400;
margin-top: 18rpx;
color: rgba(102, 102, 102, 1);
}
.assess_time {
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 400;
margin-top: 12rpx;
color: rgba(153, 153, 153, 1);
}
.ware_pic {
display:flex;
margin-top: 16rpx;
flex-wrap: wrap;
}
.ware_picBox {
flex:0 0 auto;
margin-right: 16rpx;
}
.ware_picBox image {
width: 112rpx;
height: 112rpx;
}
/* 全部评价 */
.whole {
width: 336rpx;
height: 64rpx;
background: rgba(255, 255, 255, 1);
border: 2rpx solid rgba(230, 230, 230, 1);
border-radius: 166rpx;
font-size: 26rpx;
text-align: center;
line-height: 64rpx;
font-family: PingFang SC;
font-weight: 400;
margin: auto;
color: rgba(102, 102, 102, 1);
}
/* footer */
.footer {
position: fixed;
bottom: 0;
text-align: center;
width: 750rpx;
height: 96rpx;
display: flex;
line-height: 66rpx;
align-items: center;
justify-content: center;
background: rgba(255, 255, 255, 1);
box-shadow: 0px -2rpx 12rpx rgba(0, 0, 0, 0.06);
}
.footer_add, .footer_off {
width: 272rpx;
height: 64rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 600;
border-radius: 32rpx;
border: 2rpx solid rgba(172, 212, 66, 1);
}
.footer_over{
width: 272rpx;
height: 64rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 600;
border-radius: 32rpx;
border: 2rpx solid rgba(172, 212, 66, 1);
color:#999;
}
.footer_add {
background: rgba(255, 255, 255, 1);
margin-right: 32rpx;
color: rgba(110, 172, 61, 1);
}
.footer_off {
background: linear-gradient(159deg, rgba(181, 222, 150, 1) 0%, rgba(169, 209, 33, 1) 100%);
box-shadow: 0rpx 6rpx 40rpx rgba(136, 255, 0, 0.16);
color: rgba(255, 255, 255, 1);
}
/* 遮罩层 */
.mask {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
background: #000;
z-index: 9000;
opacity: 0.64;
}
/* 弹出层 */
.modalDlg {
width: 100%;
height: 454rpx;
bottom: 0;
position: fixed;
z-index: 9999;
background-color: #fff;
}
.modalDlg_p {
padding: 0 30rpx;
}
.m_top {
display: flex;
}
.m_topTxt1 {
display: flex;
align-self: center;
justify-content: space-between;
margin-top: 30rpx;
}
.m_topTxt {
width: 100%;
margin-left: 16rpx;
}
.m_topImg {
margin-top: -48rpx;
display: flex;
}
.m_topImg image {
width: 208rpx;
height: 208rpx;
}
.m_topTxt1 image {
width: 32rpx;
height: 32rpx;
}
.m_topName {
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 600;
color: rgba(51, 51, 51, 1);
}
.m_topTxt2 {
display: flex;
margin-top: 16rpx;
align-items: center;
}
.m_topPrice {
width:120rpx;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
font-size: 28rpx;
font-family: DIN 1451 Std Mittelschrift;
font-weight: 400;
color: #f00;
}
.m_topHelf {
width:280rpx;
overflow:hidden;
text-overflow:ellipsis;
white-space:nowrap;
font-size: 22rpx;
font-family: PingFang SC;
font-weight: 400;
margin-left: 16rpx;
color: rgba(204, 204, 204, 1);
}
.m_number {
display: flex;
align-items: center;
margin-top: 18rpx;
}
.minus_push {
display: flex;
margin-left: auto;
align-items: center;
}
.m_numTxt {
font-size: 24rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(153, 153, 153, 1);
}
.minus, .push {
width: 48rpx;
height: 48rpx;
font-size: 40rpx;
text-align: center;
line-height: 48rpx;
border: 2px solid rgba(110, 172, 61, 1);
border-radius: 50%;
}
.minus {
color: #6eac3d;
}
.num {
margin: 0 26rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 400;
color: rgba(110, 172, 61, 1);
}
.push {
color: white;
background: rgba(110, 172, 61, 1);
}
.m_btn {
width: 688rpx;
height: 80rpx;
border: 0;
margin-top: 62rpx;
font-size: 32rpx;
font-family: PingFang SC;
font-weight: 600;
color: rgba(255, 255, 255, 1);
background: linear-gradient(170deg, rgba(181, 222, 150, 1) 0%, rgba(169, 209, 33, 1) 100%);
box-shadow: 0rpx 6rpx 40rpx rgba(162, 255, 0, 0.15);
border-radius: 48rpx;
}
.wxParse-inline{
color:#999;
font-size: 30rpx;
}
.wxParse-p{
display:flex;
justify-content: center;
padding-bottom: 120rpx;
}
.wxParse-p image{
display:block
}
.kefu{
width:70rpx;
height:70rpx;
position:relative;
}
.icon-kefu{
font-size: 64rpx;
color:#6EAC3D;
margin-right:20rpx;
}
.remaindetail{
position: absolute;
top:0;
right:0;
background: transparent;
width:70rpx;
height:70rpx;
}
button::after{
outline:none;
border:none;
}
\ No newline at end of file
... ...