@@ -0,0 +1,3 @@ | |||
{ | |||
"bytedanceMiniappIDE.previewScene": "default" | |||
} |
@@ -0,0 +1,129 @@ | |||
const Http = require("./utils/HttpBasics.js") | |||
const config = require("./config/config.js"); | |||
App({ | |||
data:{}, | |||
globalData:{ | |||
token: null, | |||
imgHttps: 'https://formall.oss-accelerate.aliyuncs.com/douyin/drawable-xhdpi/', | |||
platform:null,//手机型号 | |||
systemInfo:"", | |||
curHtml:"", | |||
marketName:"", | |||
mouldType:1, | |||
appId:config.weapp.AppId, | |||
selected:0, | |||
goHomeUrl:"/index/index", | |||
type:"",//存放跳转标记 | |||
previewFlag: false, //解决图片预览调用noshow | |||
skipUrl:"",//存放授权跳转地址 | |||
skip:"", | |||
avatarUrl:"",//用户头像 | |||
nickName:"",//用户姓名 | |||
templateId:[],//订阅消息模板id | |||
ifshowtab:false, | |||
}, | |||
onLaunch: function () { | |||
let that = this | |||
try { | |||
var res = tt.getSystemInfoSync(); | |||
that.statusBarHeight = res.statusBarHeight | |||
console.log(`手机型号为`,that.statusBarHeight); | |||
this.globalData.platform = res.platform | |||
} catch (error) { | |||
console.log(`获取系统信息失败`); | |||
} | |||
tt.getSystemInfo({ | |||
success(res) { | |||
that.globalData.systemInfo = res | |||
that.logn(); | |||
}, | |||
fail(res) { | |||
console.log(`getSystemInfo 调用失败`); | |||
}, | |||
}); | |||
}, | |||
statusBarHeight: 0, | |||
getTemplateId(that) { | |||
// console.log("隐藏") | |||
// tt.hideTabBar() | |||
Http.get({ | |||
url: config.api.templateId, | |||
data: { | |||
pageNum: 1, | |||
pageSize: 100 | |||
} | |||
}).then(res => { | |||
const { | |||
code, | |||
data | |||
} = res | |||
if (code == 200) { | |||
// this.setData({ | |||
// templateId: data.list | |||
// }) | |||
that.globalData.templateId = data.list | |||
} else { | |||
return | |||
} | |||
}) | |||
}, | |||
logn(){ | |||
let that = this; | |||
tt.login({ | |||
success:(res=>{ | |||
let {code} = res | |||
Http.post({ | |||
url:config.api.login, | |||
data:{ | |||
code:code, | |||
appId:that.globalData.appId, | |||
systemInfo:JSON.stringify(this.globalData.systemInfo) | |||
} | |||
}).then(res=>{ | |||
tt.setStorageSync("openId", res.data.openId); | |||
if (res.data.mall){ | |||
that.globalData.marketName = res.data.mall.name ? res.data.mall.name : "" | |||
} | |||
that.globalData.mouldType = res.data.mouldType ? res.data.mouldType:0; | |||
if (res.data.subMalls) { | |||
const squareList = JSON.parse(res.data.subMalls) | |||
tt.setStorageSync("squareList", squareList) | |||
if (res.data.mall){ | |||
tt.setStorageSync("selectedMall", res.data.mall.tenantId) | |||
} | |||
} | |||
Http.setToken(res.data.token); | |||
that.globalData.token = res.data.token | |||
that.getTemplateId(that);//获取订阅消息模板id | |||
if (that.tokenCallback) { | |||
that.tokenCallback(res.data.token); | |||
} | |||
}).catch(err=>{ | |||
console.log(err); | |||
tt.showModal({ | |||
title: '提示', | |||
showCancel: false, | |||
content: '登录失败,请重新尝试', | |||
success: (res) => { | |||
if (res.cancel) { | |||
//点击取消,默认隐藏弹框 | |||
} else { | |||
//点击确定 | |||
tt.reLaunch({ | |||
url: '/pages/index/index', | |||
}) | |||
} | |||
} | |||
}); | |||
}) | |||
}), | |||
}); | |||
} | |||
}) |
@@ -0,0 +1,50 @@ | |||
{ | |||
"pages": [ | |||
"index/index", | |||
"index/searchbar", | |||
"pages/index/index", | |||
"index/user", | |||
"pages/mainOrder/mainOrder", | |||
"pages/detailOrder/detailOrder", | |||
"pages/couponorder/index/index", | |||
"pages/couponorder/detail/index", | |||
"pages/coupon/detail/index", | |||
"pages/editUser/editUser", | |||
"pages/specialcourtesy/specialcourtesy", | |||
"pages/complaint/complaint", | |||
"pages/mallInfo/mallInfo", | |||
"pages/getuserinfo/getuserinfo", | |||
"pages/bannerdetail/bannerdetail", | |||
"pages/topicDetail/index", | |||
"pages/main/index", | |||
"pages/integralmall/index", | |||
"pages/integralmall/integraHistory/index", | |||
"pages/order/detail/index", | |||
"pages/order/index/index", | |||
"pages/orderquanma/index", | |||
"pages/edit/edit", | |||
"pages/questionnaire/questionnaire", | |||
"pages/questionnaire/questionnaireLsit/questionnaireLsit", | |||
"pages/searchbar/searchbar", | |||
"pages/index/searchbar/detail/index", | |||
"pages/integralmall/payIntegcoupondetail/index", | |||
"pages/integralmall/payIntegcouponStatus/index", | |||
"pages/getPhone/getPhone", | |||
"pages/certification/certification", | |||
"pages/shopCertification/shopCertification", | |||
"pages/shopMap/shopMap", | |||
"pages/fitShop/fitShop", | |||
"pages/paySnapshoot/paySnapshoot", | |||
"pages/refund/refund", | |||
"pages/serviceWebView/serviceWebView", | |||
"pages/liveLsit/liveLsit" | |||
], | |||
"window": { | |||
"backgroundTextStyle": "light", | |||
"navigationBarBackgroundColor": "#fff", | |||
"navigationBarTitleText": "Mini Program", | |||
"navigationBarTextStyle": "black", | |||
"navigationStyle": "custom" | |||
} | |||
} |
@@ -0,0 +1,144 @@ | |||
.BoxBg{ | |||
background-color: #f6f6f6; | |||
min-height: 100vh; | |||
} | |||
view, text { | |||
font-family: PingFangSC-Regular; | |||
} | |||
button::after{ | |||
border:none | |||
} | |||
@font-face { | |||
font-family: "iconfont"; /* project id 777313 */ | |||
src: url("//at.alicdn.com/t/font_777313_jq7td4d3uab.eot"); | |||
src: url("//at.alicdn.com/t/font_777313_jq7td4d3uab.eot?#iefix") | |||
format("embedded-opentype"), | |||
url("//at.alicdn.com/t/font_777313_jq7td4d3uab.woff") format("woff"), | |||
url("//at.alicdn.com/t/font_777313_jq7td4d3uab.ttf") format("truetype"), | |||
url("//at.alicdn.com/t/font_777313_jq7td4d3uab.svg#iconfont") format("svg"); | |||
} | |||
.iconfont { | |||
font-family: "iconfont" !important; | |||
font-size: 36rpx; | |||
font-style: normal; | |||
-webkit-font-smoothing: antialiased; | |||
-webkit-text-stroke-width: 0.2rpx; | |||
-moz-osx-font-smoothing: grayscale; | |||
} | |||
.clearfix:after { | |||
content: "."; | |||
display: block; | |||
height: 0; | |||
clear: both; | |||
visibility: hidden; | |||
} | |||
/* 定位 */ | |||
.icon-dingweib:before { | |||
content: "\e652"; | |||
} | |||
/* 三角 */ | |||
.icon-choose:before { | |||
content: "\e601"; | |||
} | |||
/* 右箭头 */ | |||
.icon-right:before { | |||
content: "\e612"; | |||
} | |||
/* 边框 */ | |||
.app-border-top, | |||
.app-border-bottom { | |||
position: relative; | |||
width: 100%; | |||
} | |||
.app-border-top::after, | |||
.app-border-bottom::after { | |||
content: ""; | |||
position: absolute; | |||
background-color: #ddd; | |||
display: block !important; | |||
z-index: 1; | |||
top: auto; | |||
right: auto; | |||
width: 100%; | |||
height: 1rpx; | |||
transform-origin: 50% 100%; | |||
transform: scaleY(0.5); | |||
} | |||
.app-border-top:last-child:after, | |||
.app-border-bottom:last-child::after { | |||
display: none !important; | |||
} | |||
.app-border-top::after { | |||
top: 0; | |||
} | |||
.app-border-bottom::after { | |||
bottom: 0; | |||
} | |||
.app-border-left, | |||
.app-border-right { | |||
position: relative; | |||
height: 100%; | |||
} | |||
.app-border-left::before, | |||
.app-border-right::before { | |||
content: ""; | |||
position: absolute; | |||
background-color: #ddd; | |||
display: block; | |||
z-index: 1; | |||
top: 0; | |||
bottom: 0; | |||
height: 100%; | |||
width: 1rpx; | |||
transform-origin: 50% 100%; | |||
transform: scaleX(0.5); | |||
} | |||
.app-border-left::before { | |||
left: 0; | |||
} | |||
.app-border-right::before { | |||
right: 0; | |||
} | |||
view, | |||
text { | |||
font-family: PingFangSC-Regular; | |||
} | |||
page { | |||
width: 100%; | |||
min-height: 100vh; | |||
font-weight: 400; | |||
padding-bottom: 160rpx; | |||
background: #F4F5F9; | |||
} | |||
.fl{ | |||
float: left; | |||
} | |||
.fr{ | |||
float: right; | |||
} | |||
.canWrap{ | |||
position: fixed; | |||
bottom: -20000rpx; | |||
left: -2000rpx; | |||
width: 100%; | |||
height: 100%; | |||
overflow: visible; | |||
} | |||
.canWrap canvas{ | |||
width: 690rpx; | |||
height: 450rpx; | |||
} | |||
@@ -0,0 +1,38 @@ | |||
// components/advertisement.js | |||
const Http = require("../../utils/HttpBasics"); | |||
var config = require("../../config/config.js"); | |||
Component({ | |||
properties: { | |||
ggdata: { | |||
type: Object, | |||
value: {} | |||
} | |||
}, | |||
data: { | |||
flag: false, | |||
alphaData1: null, | |||
}, | |||
methods: { | |||
gotoGg: function (e) { | |||
console.log(this.data.ggdata) | |||
let that = this; | |||
tt.navigateTo({ | |||
url: `/${that.data.ggdata.pagePath}&g=1`, | |||
}) | |||
}, | |||
a: function () { | |||
this.setData({ flag: false }) | |||
}, | |||
closeGg: function () { | |||
let that = this; | |||
var animation = tt.createAnimation({}) | |||
// animation.opacity(0).step({ duration: 1000 }) | |||
setTimeout(function () { | |||
that.setData({ flag: true }) | |||
}, 500) | |||
animation.rotateZ(180).scale(0).opacity(0.5).step({ duration: 1000 }) | |||
that.setData({ alphaData1: animation.export() }); | |||
}, | |||
}, | |||
}); |
@@ -0,0 +1,4 @@ | |||
{ | |||
"component": true, | |||
"usingComponents": {} | |||
} |
@@ -0,0 +1,12 @@ | |||
<!--components/advertisement.wxml--> | |||
<view class="b1" hidden="{{flag}}"> | |||
<view class='b3'> | |||
<view class="t_w"> | |||
<view class="b2" animation="{{alphaData}}"> | |||
<icon type="cancel" size="30" color="#fff" class='cancel_icon' bindtap="closeGg"/> | |||
<!-- <view class='line'></view> --> | |||
<image class="t_image" data-data="{{ggdata}}" mode='widthFix' src="{{ggdata.coverImg}}" bindtap="gotoGg" data-couponChannelId="{{ggdata.produceId}}" /> | |||
</view> | |||
</view> | |||
</view> | |||
</view> |
@@ -0,0 +1,47 @@ | |||
/* components/advertisement.wxss */ | |||
.b1{ | |||
position:fixed; | |||
width:100%; | |||
height:100%; | |||
top:0px; | |||
background:rgba(0,0,0,0.8); | |||
overflow: hidden; | |||
z-index: 1000; | |||
} | |||
.b3{ | |||
/* margin:0 auto; */ | |||
width:100%; | |||
height:100%; | |||
position:relative; | |||
} | |||
.t_w{ | |||
width: 100%; | |||
position: absolute; | |||
top: 50%; | |||
left: 50%; | |||
margin-top: -50%; | |||
margin-left: -50%; | |||
} | |||
.b2{ | |||
overflow: hidden; | |||
border-radius: 10rpx; | |||
} | |||
.t_image{ | |||
width: 70%; | |||
border-radius: 16rpx; | |||
display: block; | |||
margin: 0 auto; | |||
} | |||
.cancel_icon{ | |||
position: absolute; | |||
right: 65rpx; | |||
top: -40rpx; | |||
} | |||
.line{ | |||
width:2rpx; | |||
height: 75rpx; | |||
background: #fff; | |||
position: absolute; | |||
right: 370rpx; | |||
bottom: -125rpx; | |||
} |
@@ -0,0 +1,93 @@ | |||
// pages/index/sw/index.js | |||
const imgurl = require("../../utils/imgurl"); | |||
const app = getApp() | |||
Component({ | |||
/** | |||
* 组件的属性列表 | |||
*/ | |||
properties: { | |||
list: { | |||
value: [], | |||
type: Array | |||
} | |||
}, | |||
/** | |||
* 组件的初始数据 | |||
*/ | |||
data: { | |||
bannerUrl: imgurl.banner.url, | |||
currentIndex: 0, | |||
mouldType:0, | |||
}, | |||
/** | |||
* 组件的方法列表 | |||
*/ | |||
methods: { | |||
gotobannerdetail: function(e) { | |||
console.log(this.data.list) | |||
if (e.currentTarget.dataset.data.type == 3) { | |||
// 小程序路径 | |||
let indexOf = (e.currentTarget.dataset.data.pagePath).indexOf("="); | |||
console.log(indexOf, "123") | |||
let id = (e.currentTarget.dataset.data.pagePath).substr(indexOf); | |||
console.log(id.split("="),123); | |||
let type = (e.currentTarget.dataset.data.pagePath).substr(indexOf + 1, 2)// 2020/7/22 变量获取pagePath中的type | |||
console.log(indexOf, id, type); | |||
console.log(e.currentTarget.dataset.data.pagePath) | |||
if(type == 'cd' || type == 'sd'){ | |||
tt.navigateTo({ | |||
url: `/${e.currentTarget.dataset.data.pagePath}`, | |||
}) | |||
}else if(type == "wj"){ | |||
tt.navigateTo({ | |||
url: `/pages/questionnaire/questionnaire?id=`+id.split("=")[2], | |||
}) | |||
}else if (type == 'ra'){ | |||
tt.navigateTo({ | |||
url: `/pages/radetail/index?id=`+id.split("=")[2], | |||
}) | |||
} | |||
}else if(e.currentTarget.dataset.data.type==2){ | |||
// 自由图文 | |||
tt.navigateTo({ | |||
url: `/pages/freeBannerDetail/index?id=${e.currentTarget.dataset.id}` | |||
}); | |||
}else if(e.currentTarget.dataset.data.type==4){ | |||
tt.navigateToMiniProgram({ | |||
appId: e.currentTarget.dataset.data.goAppid, | |||
// path: 'page/index/index?id=123', | |||
// extraData: { | |||
// foo: 'bar' | |||
// }, | |||
// envVersion: 'develop', | |||
success(res) { | |||
// 打开成功 | |||
} | |||
}) | |||
} | |||
else{ | |||
// 固定格式 | |||
tt.navigateTo({ | |||
url: `/pages/bannerdetail/bannerdetail?id=${e.currentTarget.dataset.id}` | |||
}); | |||
} | |||
}, | |||
handleChange: function (e) { | |||
this.setData({ | |||
currentIndex: e.detail.current | |||
}) | |||
}, | |||
}, | |||
attached: function () { | |||
// 在组件实例进入页面节点树时执行 | |||
if (app.globalData.mouldType){ | |||
this.setData({ | |||
mouldType: app.globalData.mouldType | |||
}) | |||
} | |||
}, | |||
}); |
@@ -0,0 +1,4 @@ | |||
{ | |||
"component": true, | |||
"usingComponents": {} | |||
} |
@@ -0,0 +1,19 @@ | |||
<view tt:if="{{list.length>0&&mouldType==0}}" class="index-slide-view"> | |||
<swiper class="imageContainer" bindchange="handleChange" previous-margin="39rpx" next-margin="40rpx" circular autoplay> | |||
<block tt:for="{{list}}" tt:key="{{index}}"> | |||
<swiper-item class="item"> | |||
<image data-id="{{item.id}}" data-data="{{item}}" bindtap='gotobannerdetail' class="itemImg {{currentIndex == index ? 'active': ''}}" src="{{item.coverImg}}"></image> | |||
</swiper-item> | |||
</block> | |||
</swiper> | |||
</view> | |||
<view tt:if="{{list.length>0&&mouldType==1}}" class="index-slide-view1"> | |||
<swiper class="imageContainer1" bindchange="handleChange" indicator-color indicator-active-color="#fff" indicator-dots circular autoplay> | |||
<block tt:for="{{list}}" tt:key="{{index}}"> | |||
<swiper-item class="item1"> | |||
<image data-id="{{item.id}}" data-data="{{item}}" bindtap='gotobannerdetail' class="itemImg1 {{currentIndex == index ? 'active1_a': 'active1'}}" src="{{item.coverImg}}"></image> | |||
</swiper-item> | |||
</block> | |||
</swiper> | |||
</view> |
@@ -0,0 +1,83 @@ | |||
.imageContainer { | |||
width: 100%; | |||
height: 304rpx; | |||
} | |||
.itemImg { | |||
position: absolute; | |||
width: 640rpx; | |||
height: 227rpx; | |||
border-radius: 15rpx; | |||
overflow: hidden; | |||
z-index: 5; | |||
opacity: 0.7; | |||
top: 20%; | |||
margin: 0 20rpx; | |||
} | |||
.active { | |||
opacity: 1; | |||
z-index: 10; | |||
width: 640rpx; | |||
height: 270rpx; | |||
top: 11%; | |||
transition: all 0.2s ease-in 0s; | |||
} | |||
.item { | |||
width: 100%; | |||
height: 304rpx; | |||
overflow: hidden; | |||
border-radius: 16rpx; | |||
} | |||
.index-slide-view { | |||
margin-top: -30rpx; | |||
} | |||
.index-slide-view1 { | |||
/* margin-top: -40rpx; */ | |||
} | |||
.imageContainer1 { | |||
width: 100%; | |||
height: 420rpx; | |||
} | |||
.itemImg1 { | |||
/* position: absolute; */ | |||
width: 100%; | |||
height: 420rpx; | |||
/* border-radius: 15rpx; */ | |||
overflow: hidden; | |||
z-index: 5; | |||
opacity: 0.7; | |||
/* top: 12%; */ | |||
/* margin: 0 20rpx; */ | |||
} | |||
.active1_a { | |||
opacity: 1; | |||
z-index: 10; | |||
width: 100%; | |||
height: 420rpx; | |||
/* top: 11%; */ | |||
transition: all 0.2s ease-in 0s; | |||
} | |||
.active1 { | |||
opacity: 1; | |||
z-index: 10; | |||
width: 100%; | |||
height: 420rpx; | |||
/* top: 17%; */ | |||
transition: all 0.2s ease-in 0s; | |||
} | |||
.item1 { | |||
width: 100%; | |||
/* height: 360rpx; */ | |||
height: 420rpx; | |||
overflow: hidden; | |||
/* border-radius: 16rpx; */ | |||
} | |||
@@ -0,0 +1,32 @@ | |||
Component({ | |||
data: { | |||
schedule:0 | |||
}, | |||
properties: { | |||
item:{ | |||
type:Object, | |||
value:{} | |||
} | |||
}, | |||
methods: { | |||
go(e){ | |||
let url = e.currentTarget.dataset.url | |||
tt.navigateTo({ | |||
url: url, // 指定页面的 url | |||
success: (res) => { | |||
}, | |||
fail: (res) => { | |||
}, | |||
}); | |||
} | |||
}, | |||
// created:function(){ | |||
// } | |||
}) |
@@ -0,0 +1,4 @@ | |||
{ | |||
"component": true, | |||
"usingComponents": {} | |||
} |
@@ -0,0 +1,27 @@ | |||
<view class="commodityBox" bindtap="go" data-url="/pages/coupon/detail/index?id={{item.id}}&navbarTitle={{item.title}}"> | |||
<view class="commodiImg"> | |||
<image src="{{item.coverImg}}" class="img"/> | |||
</view> | |||
<view class="textBox"> | |||
<view class="title">{{item.title}}</view> | |||
<view class="marketBox"> | |||
<view class="progress"> | |||
<view class="progress_a" style="{{item.schedule}}"></view> | |||
</view> | |||
<view class="progressText">{{item.remainInventoryText}}</view> | |||
</view> | |||
<view class="payBox"> | |||
<view class="payNumBox"> | |||
<view style="overflow:hidden"> | |||
<view class="payIcon">¥</view> | |||
<view class="price">{{item.salePriceStr}}</view> | |||
</view> | |||
<view class="original">¥{{item.priceStr}}</view> | |||
</view> | |||
<view tt:if="{{item.salePriceStr==0&&item.remainInventory!=0&&item.targetAd==101}}" class="payBtn">免费领取</view> | |||
<view tt:if="{{item.salePriceStr!=0&&item.remainInventory!=0&&item.targetAd==101}}" class="payBtn">立即购买</view> | |||
<view tt:if="{{item.salePriceStr!=0&&item.remainInventory==0&&item.targetAd==101}}" class="noBtn" class="payBtn">已售空</view> | |||
</view> | |||
</view> | |||
</view> |
@@ -0,0 +1,121 @@ | |||
.commodityBox{ | |||
width:96%; | |||
margin: 20rpx auto 0 auto; | |||
background-color: #ffffff; | |||
overflow: hidden; | |||
border-radius: 10rpx; | |||
} | |||
.commodiImg{ | |||
float: left; | |||
width: 300rpx; | |||
height: 176rpx; | |||
border-radius: 10rpx; | |||
/* background-color: aqua; */ | |||
margin: 20rpx; | |||
} | |||
.img{ | |||
width: 300rpx; | |||
height: 176rpx; | |||
border-radius: 10rpx; | |||
} | |||
.textBox{ | |||
width: 50%; | |||
float: left; | |||
margin-top: 20rpx; | |||
font-size: 28rpx; | |||
} | |||
.title{ | |||
height: 80rpx; | |||
overflow:hidden; | |||
text-overflow:ellipsis; | |||
display:-webkit-box; | |||
-webkit-box-orient:vertical; | |||
-webkit-line-clamp:2; | |||
font-size: 30rpx; | |||
font-weight: 500; | |||
} | |||
.marketBox{ | |||
overflow: hidden; | |||
height: 40rpx; | |||
} | |||
.progress{ | |||
height: 20rpx; | |||
width: 46%; | |||
border-radius: 10rpx; | |||
float: left; | |||
background-color: #e6e6e6; | |||
margin-top: 10rpx; | |||
position: relative; | |||
overflow: hidden; | |||
} | |||
.progress_a{ | |||
/* width: 20%; */ | |||
height: 20rpx; | |||
/* border-radius: 10rpx; */ | |||
background-color: #fb3e5c; | |||
position: absolute; | |||
top: 0; | |||
left: 0; | |||
} | |||
.progressText{ | |||
float: right; | |||
width: 50%; | |||
font-size: 26rpx; | |||
color: #707070; | |||
} | |||
.payBox{ | |||
overflow: hidden; | |||
} | |||
.payNumBox{ | |||
float: left; | |||
/* overflow: hidden; | |||
height: 40rpx; */ | |||
} | |||
.payIcon{ | |||
font-size: 24rpx; | |||
float: left; | |||
color: #fb3e5c; | |||
line-height: 40rpx; | |||
} | |||
.price{ | |||
height: 40rpx; | |||
line-height: 40rpx; | |||
float: left; | |||
font-size: 30rpx; | |||
color: #fb3e5c; | |||
} | |||
.original{ | |||
font-size: 26rpx; | |||
color: #707070; | |||
text-decoration: line-through; | |||
} | |||
.payBtn{ | |||
color: #fff; | |||
background:linear-gradient(to right,#fc3e5a,#f86883); | |||
float: right; | |||
margin-right: 10%; | |||
margin-top: 20rpx; | |||
height: 60rpx; | |||
line-height: 60rpx; | |||
width: 180rpx; | |||
text-align: center; | |||
border-radius: 60rpx; | |||
margin-bottom: 20rpx; | |||
} | |||
.noBtn{ | |||
color: #fff; | |||
background:#e6e6e6; | |||
float: right; | |||
margin-right: 10%; | |||
margin-top: 20rpx; | |||
height: 60rpx; | |||
line-height: 60rpx; | |||
width: 180rpx; | |||
text-align: center; | |||
border-radius: 60rpx; | |||
margin-bottom: 20rpx; | |||
} | |||
@@ -0,0 +1,133 @@ | |||
const util = require("../../utils/util"); | |||
Component({ | |||
/** | |||
* 组件的属性列表 util.toHHmmss(res.data.endTime,); | |||
*/ | |||
properties: { | |||
special:{ | |||
type: Boolean, | |||
value: false | |||
}, | |||
titleImgUrl:{ | |||
type:String, | |||
value:"", | |||
}, | |||
isShowCount:{ | |||
type: Boolean, | |||
value: false | |||
}, | |||
obj:{ | |||
type:Object, | |||
value:{} | |||
} | |||
}, | |||
/** | |||
* 组件的初始数据 | |||
*/ | |||
data: { | |||
setIntervalLsit:[] | |||
}, | |||
attached: function () { | |||
let this_ =this | |||
let arr = [] | |||
let tempLsit = [] | |||
// 处理首页定时 | |||
if (this_.properties.obj.couponList!=null&&this_.properties.obj.couponList.length>0){ | |||
//限时抢购 倒计时 | |||
this_.properties.obj.couponList.map((item,index)=>{//初次渲染 | |||
if (item.targetAd==2){ | |||
let tempObj = {} | |||
let beginTime = item.beginTime;//开始时间 | |||
let endTime = item.endTime;//结束时间 | |||
let present = new Date().getTime()//当前时间 | |||
let textTime = item.beginTime >= present?"距开始":"距结束" | |||
tempObj={ | |||
value: item.beginTime >= present ? beginTime - present : endTime - present, | |||
valueText: item.beginTime >= present ? util.toHHmmss(beginTime - present) : util.toHHmmss(endTime - present), | |||
// vaFlag: tempObj.value<=0?true:false,//活动是否结束 | |||
index:index, | |||
interval:"" , | |||
beginTime: beginTime,//开始时间 | |||
endTime: endTime,//开始时间 | |||
textTime: textTime | |||
} | |||
arr.push(tempObj) | |||
this_.setData({ | |||
setIntervalLsit: arr | |||
}) | |||
} | |||
}) | |||
} | |||
tempLsit =this_.data.setIntervalLsit | |||
tempLsit.map((item,index)=>{//再次渲染 | |||
item.interval = setInterval(function(){ | |||
let present = new Date().getTime()//当前时间 | |||
if(item.value<=1){ | |||
clearInterval(item.interval) | |||
item.vaFlag = true,//活动是否结束 | |||
console.log(item.value, "活动已经结束") | |||
}else{ | |||
let tempTime = item.beginTime >= present ? item.beginTime - present : item.endTime - present | |||
// console.log(tempTime, "presents") | |||
item.value = tempTime, | |||
item.valueText = util.toHHmmss(tempTime - 1000) | |||
item.textTime = item.beginTime >= present ? "距开始" : "距结束", | |||
item.vaFlag= item.value <= 0 ? true : false,//活动是否结束 | |||
this_.setData({ | |||
setIntervalLsit: tempLsit | |||
}) | |||
} | |||
},1000) | |||
}) | |||
// 处理首页定时 | |||
}, | |||
detached: function () { | |||
this.data.setIntervalLsit.map(item=>{ | |||
clearInterval(item.interval) | |||
}) | |||
console.log("88888") | |||
// 在组件实例被从页面节点树移除时执行 ; | |||
}, | |||
/** | |||
* 组件的方法列表 | |||
*/ | |||
methods: { | |||
lookAll(){ | |||
tt.navigateTo({ | |||
url: `/${this.properties.obj.weappPath}`, | |||
}) | |||
}, | |||
goDetail(e){ | |||
console.log(e.currentTarget.dataset) | |||
let couponChannelId = e.currentTarget.dataset.id | |||
let couponId = e.currentTarget.dataset.couponid | |||
let type = e.currentTarget.dataset.type | |||
if (type==9){ | |||
tt.navigateTo({ | |||
url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${couponChannelId}&couponId=${couponId}`, | |||
}) | |||
}else{ | |||
tt.navigateTo({ | |||
url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`, | |||
}) | |||
} | |||
}, | |||
gotoTopic(e) { | |||
let id = e.currentTarget.dataset.id | |||
tt.navigateTo({ | |||
url: `/pages/topicDetail/index?id=${id}` | |||
}) | |||
}, | |||
} | |||
}) |
@@ -0,0 +1,4 @@ | |||
{ | |||
"component": true, | |||
"usingComponents": {} | |||
} |
@@ -0,0 +1,86 @@ | |||
<!-- <view class='product' tt:if="{{showTopic}}" bindtap='gotoTopic'> | |||
<image src='{{cover}}' mode='widthFix'></image> | |||
</view> --> | |||
<view tt:if="{{obj.couponList.length>0||obj.isOnlyAd==1}}" class="{{obj.isOnlyAd==1?'':'BoxX'}}"> | |||
<view class='product' bindtap='gotoTopic' data-id="{{obj.id}}" tt:if="{{obj.isOnlyAd==1}}"> | |||
<image src='{{obj.cover}}' mode='scaleToFill'></image> | |||
</view> | |||
<view class="commBox" tt:if="{{obj.topicType!=1||(obj.topicType==1&&obj.isOnlyAd==0)}}"> | |||
<view class="titleBox"> | |||
<image class="titleImg" src="{{titleImgUrl}}" tt:if="{{!special}}"></image> | |||
<view class="specialTitle" tt:if="{{special}}">{{obj.name}}</view> | |||
<view class="more" bindtap="lookAll">查看更多优惠活动 | |||
<image class="rup" src="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_icon_jt.png"></image> | |||
</view> | |||
</view> | |||
<view class="contBox"> | |||
<view class="topImg" tt:if="{{obj.cover}}" bindtap="lookAll"> | |||
<image src="{{obj.cover}}" mode='scaleToFill'></image> | |||
</view> | |||
<div class="itemBox" tt:if="{{obj.couponList&&obj.couponList.length>0}}"> | |||
<view class="item" tt:for="{{obj.couponList}}" tt:key="index" bindtap="goDetail" data-type="{{item.type}}" data-id="{{item.id}}" data-couponid="{{item.couponId}}"> | |||
<view class="itemImg"> | |||
<image src="{{item.coverImg}}" mode='scaleToFill'></image> | |||
<view class="sellout" tt:if="{{item.remainInventory==0}}"> | |||
<image class="selloutImg" src="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_img_ysx.png"></image> | |||
</view> | |||
</view> | |||
<view class="titleNameBox"> | |||
<view class="titleName">{{item.title}}</view> | |||
</view> | |||
<!-- <view class="priceBox"> | |||
<view class="sellingBox f"> | |||
<view class="fuhao">¥</view> | |||
<view class="int" tt:if="{{item.type!=50}}">{{item.salePriceStrQ?item.salePriceStrQ:item.salePriceStr}}</view> | |||
<view class="fuhao" tt:if="{{item.type!=50}}">{{item.salePriceStrH?'.'+item.salePriceStrH:''}}</view> | |||
<view class="int" tt:if="{{item.type==50}}">{{item.creditPrice}}</view> | |||
<view class="fuhao" tt:if="{{item.type==50}}"> 积分</view> | |||
</view> | |||
<view class="originalBox r"> | |||
<view class="origina">¥{{item.priceStr}}</view> | |||
</view> | |||
</view> --> | |||
<view class="priceBox"> | |||
<view class="sellingBox f"> | |||
<view class="fuhaoX" tt:if="{{item.type!=50}}" >¥{{item.salePriceStr?item.salePriceStr:""}}</view> | |||
<view class="fuhaoX" tt:if="{{item.type==50}}"> {{item.creditPrice}}积分</view> | |||
</view> | |||
<view class="originalBox r" tt:if="{{item.type!=50}}"> | |||
<view class="r btn" >马上抢</view> | |||
</view> | |||
<view class="originalBox f" tt:if="{{item.type==50}}"> | |||
<view class="originaX">¥{{item.priceStr}}</view> | |||
</view> | |||
</view> | |||
<view class="jifengBtn" tt:if="{{item.type==50}}"> | |||
立即兑换 | |||
</view> | |||
<view class="countBox" tt:if="{{isShowCount}}"> | |||
<view class="countText f">{{setIntervalLsit[index].textTime}}</view> | |||
<view class="countDate r">{{setIntervalLsit[index].vaFlag?'活动已结束':setIntervalLsit[index].valueText}}</view> | |||
</view> | |||
</view> | |||
<view class="item moreItem" bindtap="lookAll"> | |||
<view class="noDataImg"> | |||
<image src="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_img_zwlp.png"></image> | |||
</view> | |||
<view class="noDataText">查看更多优惠活动</view> | |||
</view> | |||
</div> | |||
</view> | |||
</view> | |||
</view> |
@@ -0,0 +1,313 @@ | |||
.BoxX{ | |||
overflow: hidden; | |||
background-image: url("https://formall.oss-accelerate.aliyuncs.com/douyin_ifomall/imgData/cmdBg.png"); | |||
background-size: 100% auto;background-repeat: no-repeat; | |||
} | |||
.commBox { | |||
width: 96%; | |||
margin: 27rpx auto; | |||
background-color: #fff; | |||
border-radius: 20rpx; | |||
overflow: hidden; | |||
} | |||
.titleBox { | |||
width: 100%; | |||
overflow: hidden; | |||
height: 140rpx; | |||
background-image: url("https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_icon_d9qt.png"); | |||
background-size: 100% 100%; | |||
background-repeat: no-repeat; | |||
} | |||
.titleImg { | |||
width: 180rpx; | |||
height: 40rpx; | |||
float: left; | |||
margin: 20rpx; | |||
display: block; | |||
} | |||
.specialTitle { | |||
float: left; | |||
margin: 10rpx 20rpx; | |||
font-size: 38rpx; | |||
font-family: YouSheBiaoTiHei; | |||
font-weight: 600; | |||
color: #37332d; | |||
} | |||
.more { | |||
float: right; | |||
font-size: 24rpx; | |||
font-family: OPPOSans; | |||
font-weight: 500; | |||
color: #866741; | |||
margin: 16rpx 20rpx; | |||
} | |||
.rup { | |||
width: 13rpx; | |||
height: 20rpx; | |||
margin: 2rpx 0 0 6rpx; | |||
} | |||
.contBox { | |||
overflow: hidden; | |||
/* width: 96%; */ | |||
margin: -50rpx auto 0 auto; | |||
} | |||
.topImg { | |||
width: 100%; | |||
height: 140rpx; | |||
border-radius: 16rpx; | |||
margin-bottom: 40rpx; | |||
/* background-color: chartreuse; */ | |||
} | |||
.topImg image { | |||
border-radius: 16rpx; | |||
width: 100%; | |||
height: 100%; | |||
} | |||
.itemBox { | |||
overflow: hidden; | |||
display: -webkit-box; | |||
overflow-x: scroll; | |||
-webkit-overflow-scrolling: touch; | |||
margin: 20rpx auto; | |||
width: 96%; | |||
} | |||
.itemBox::-webkit-scrollbar { | |||
display: none; | |||
} | |||
.item { | |||
width: 240rpx; | |||
/* background-color: antiquewhite; */ | |||
margin-right: 20rpx; | |||
} | |||
.itemImg { | |||
position: relative; | |||
width: 240rpx; | |||
height: 240rpx; | |||
border-radius: 16rpx; | |||
/* background-color: aquamarine; */ | |||
} | |||
.itemImg image { | |||
width: 100%; | |||
height: 100%; | |||
border-radius: 16rpx; | |||
} | |||
.sellout { | |||
position: absolute; | |||
top: 0; | |||
left: 0; | |||
background-color: rgba(0, 0, 0, 0.5); | |||
width: 240rpx; | |||
height: 240rpx; | |||
border-radius: 20rpx; | |||
} | |||
.selloutImg { | |||
width: 195rpx !important; | |||
height: 154rpx !important; | |||
margin: 18% auto; | |||
display: block; | |||
} | |||
.titleNameBox { | |||
margin-top: 16rpx; | |||
height: 72rpx; | |||
line-height: 36rpx; | |||
display: flex; | |||
align-items: center; | |||
justify-content: center; | |||
} | |||
.titleName { | |||
color: #402e1e; | |||
font-size: 30rpx; | |||
font-family: "PingFangSC-Regular"; | |||
font-weight: 400; | |||
width: 100%; | |||
font-size: 28rpx; | |||
/* font-family: OPPOSans; */ | |||
/* font-weight: 500; */ | |||
/* color: #333; */ | |||
display: -webkit-box; | |||
-webkit-line-clamp: 2; | |||
-webkit-box-orient: vertical; | |||
overflow: hidden; | |||
text-overflow: ellipsis; | |||
} | |||
.priceBox { | |||
overflow: hidden; | |||
margin: 0 0 10rpx 0; | |||
height: 56rpx; | |||
} | |||
.f { | |||
float: left; | |||
} | |||
.r { | |||
float: right; | |||
} | |||
.sellingBox { | |||
overflow: hidden; | |||
height: 100%; | |||
line-height: 56rpx; | |||
} | |||
.fuhao { | |||
color: #df2d2d; | |||
font-size: 24rpx; | |||
float: left; | |||
font-family: OPPOSans; | |||
/* font-weight: bold; */ | |||
margin-top: 10rpx; | |||
} | |||
.fuhaoX{ | |||
color: #d5af67; | |||
font-family: "PingFangSC-Medium"; | |||
font-size: 30rpx; | |||
font-weight: 400; | |||
float: left; | |||
} | |||
.btn{ | |||
width: 116rpx; | |||
height: 52rpx; | |||
border-radius: 26rpx; | |||
line-height: 52rpx; | |||
background: linear-gradient(90deg, #E3BA79, #BC8D3E); | |||
text-align: center; | |||
color: #feffff; | |||
font-family: "PingFangSC-Regular"; | |||
font-size: 26rpx; | |||
font-weight: 400; | |||
} | |||
.int { | |||
float: left; | |||
font-size: 36rpx; | |||
font-family: OPPOSans; | |||
font-weight: bold; | |||
color: #df2d2d; | |||
} | |||
.originalBox { | |||
overflow: hidden; | |||
height: 100%; | |||
line-height: 56rpx; | |||
} | |||
.origina { | |||
text-align: right; | |||
font-size: 24rpx; | |||
font-family: OPPOSans; | |||
font-weight: 400; | |||
text-decoration: line-through; | |||
color: #999; | |||
margin-top: 10rpx; | |||
margin-right: 10rpx; | |||
} | |||
.originaX{ | |||
color: #a4a4a4; | |||
font-family: "PingFangSC-Regular"; | |||
font-size: 24rpx; | |||
font-weight: 400; | |||
line-height: 30rpx; | |||
text-decoration: line-through; | |||
/* margin-top: 10rpx; */ | |||
line-height: 60rpx; | |||
margin-left: 10rpx; | |||
} | |||
.jifengBtn{ | |||
background: linear-gradient(90deg, #E3BA79, #BC8D3E); | |||
color: #fff1d9; | |||
font-family: "PingFangSC-Medium"; | |||
font-size: 26rpx; | |||
font-weight: 400; | |||
line-height: 52rpx; | |||
text-align: center; | |||
border-radius: 2rpx; | |||
} | |||
.countBox { | |||
width: 100%; | |||
height: 46rpx; | |||
background-image: url("https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_icon_bq.png"); | |||
background-size: 100% 100%; | |||
background-repeat: no-repeat; | |||
margin-bottom: 20rpx; | |||
line-height: 46rpx; | |||
overflow: hidden; | |||
} | |||
.countText { | |||
font-size: 22rpx; | |||
font-family: OPPOSans; | |||
font-weight: 400; | |||
color: #999; | |||
background: linear-gradient(180deg, #dcb07d 0%, #f5e0bf 100%); | |||
-webkit-background-clip: text; | |||
-webkit-text-fill-color: transparent; | |||
margin-left: 8rpx; | |||
} | |||
.countDate { | |||
font-size: 24rpx; | |||
font-family: OPPOSans; | |||
font-weight: bold; | |||
color: #4c3820; | |||
margin-right: 8rpx; | |||
} | |||
.moreItem { | |||
background: #f7f7f7; | |||
border-radius: 8px; | |||
} | |||
.noDataImg { | |||
width: 160rpx; | |||
height: 160rpx; | |||
margin: 25% auto 5% auto; | |||
} | |||
.noDataImg image { | |||
width: 100%; | |||
height: 100%; | |||
} | |||
.noDataText { | |||
text-align: center; | |||
font-size: 22rpx; | |||
font-family: OPPOSans; | |||
font-weight: 500; | |||
color: #999; | |||
} | |||
.product { | |||
width: 96%; | |||
height: 140rpx; | |||
margin: 30rpx auto 10rpx; | |||
border-radius: 16rpx; | |||
overflow: hidden; | |||
} | |||
.product image { | |||
height: 100%; | |||
display: block; | |||
width: 100%; | |||
} | |||
@@ -0,0 +1,46 @@ | |||
const app = getApp() | |||
Component({ | |||
/** | |||
* 组件的属性列表 | |||
*/ | |||
properties: { | |||
paramAtoB: String, | |||
from: String, | |||
data: { | |||
value: {}, | |||
type: Object | |||
}, | |||
}, | |||
/** | |||
* 组件的初始数据 | |||
*/ | |||
data: { | |||
mouldType: 0, | |||
}, | |||
attached: function () { | |||
// 在组件实例进入页面节点树时执行 | |||
if (app.globalData.mouldType) { | |||
this.setData({ | |||
mouldType: app.globalData.mouldType | |||
}) | |||
} | |||
}, | |||
methods: { | |||
gotoDetail(e) { | |||
let couponId = e.currentTarget.dataset.couponid; | |||
let title = e.currentTarget.dataset.title; | |||
let id = e.currentTarget.dataset.id; | |||
let targetAd = e.currentTarget.dataset.targetad; | |||
if (id && targetAd != 7) { | |||
tt.navigateTo({ | |||
url: `/pages/coupon/detail/index?couponChannelId=${id}&couponId=${couponId}&title=${title}`, | |||
}) | |||
} else if (targetAd == 7) { | |||
tt.navigateTo({ | |||
url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${id}&couponId=${couponId}&title=${title}`, | |||
}) | |||
} | |||
} | |||
} | |||
}); |
@@ -0,0 +1,6 @@ | |||
{ | |||
"component": true, | |||
"usingComponents": { | |||
"i-button": "../../dist/button/index" | |||
} | |||
} |
@@ -0,0 +1,97 @@ | |||
<view class='navigator' bindtap='gotoDetail' data-id='{{data.id}}' data-targetAd='{{data.targetAd}}' hover-class='hover' | |||
data-couponId='{{data.couponId}}' data-title='{{data.title}}'> | |||
<view class="presell" tt:if="{{data.type==10}}" style="{{mouldType==1?'top: 280rpx;':''}}">预售 </view> | |||
<!-- 首页优惠券列表页面 --> | |||
<view class="coupons"> | |||
<!-- fromMerchant 根据这个字段判断 --> | |||
<view class="superscript" tt:if="{{from == 'fromMerchant'}}"> | |||
<!-- 角标的三种实现 --> | |||
<view class="rect" style='background: #31b968;' tt:if="{{data.targetAd == 2}}"></view> | |||
<view class="rect" style='background: orange;' tt:if="{{data.targetAd == 6}}"></view> | |||
<view class="rect" style='background: #d900ae;' tt:if="{{data.targetAd == 7}}"></view> | |||
<view class="rect" style='background: #5dae01;' tt:if="{{data.targetAd == 5}}"></view> | |||
<view class="desc" tt:if="{{data.targetAd == 2}}">限时券</view> | |||
<view class="desc" tt:if="{{data.targetAd == 6}}">砍价券</view> | |||
<view class="desc" tt:if="{{data.targetAd == 7}}">拼团券</view> | |||
<view class="desc" tt:if="{{data.targetAd == 5}}">消费卡</view> | |||
</view> | |||
<view class="coupons-img"> | |||
<image src="{{data.coverImg}}" style="{{mouldType==1?'height: 300rpx;':''}}" mode='aspectFill' lazy-load="true"> | |||
</image> | |||
</view> | |||
<view class="coupons-info"> | |||
<view class="coupons-info-name tit">{{data.title}}</view> | |||
<view class="coupons-info-name subtitle">{{data.subTitle}}</view> | |||
<view class="coupons-info-price-p"> | |||
<view class='price' tt:if="{{data.type!=10&&mouldType==1}}"> | |||
<view class="fuhaoX"> ¥{{data.salePriceStr}}</view> | |||
</view> | |||
<view class='price' tt:if="{{data.type!=10&&mouldType!=1}}"> | |||
<text tt:if="{{data.targetAd == 101||data.targetAd == 5}}"><text class='rmb'>¥</text> | |||
<text class='num'>{{data.salePriceStr}}</text> | |||
<text tt:if="{{!(data.type==5&&data.unit==1)}}" class='view02'>¥{{data.priceStr}}</text> | |||
</text> | |||
<text tt:if="{{data.targetAd == 2}}"><text class='saleprice'>抢购价</text> | |||
<text class='rmb'>¥</text>{{data.salePriceStr}} | |||
</text> | |||
<text tt:if="{{data.targetAd == 6}}"><text class='saleprice'>可砍至</text> | |||
<text class='rmb'>¥</text>{{data.salePriceStr}} | |||
</text> | |||
<text tt:if="{{data.targetAd == 7}}"><text class='saleprice'>拼团价</text> | |||
<text class='rmb'>¥</text>{{data.salePriceStr}} | |||
</text> | |||
<view class="coupons-info-manjian" style="margin-top:10rpx;" tt:if="{{data.type == 1}}"> | |||
<!-- <view class='view01' tt:if="{{data.unit==0}}">¥{{data.priceStr}}</view> --> | |||
<view tt:if="{{data.unit==1}}">{{data.priceStr}}小时</view> | |||
</view> | |||
<view class="coupons-info-manjian" tt:elif="{{data.type == 3||data.type==4||data.type==5}}"> | |||
<!-- <text class='view01' tt:if="{{data.unit==0}}">¥{{data.priceStr}}</text> --> | |||
<text tt:if="{{data.unit==1}}">{{data.priceStr}}小时</text> | |||
</view> | |||
</view> | |||
<view class="earnest" tt:if="{{data.type==10}}"> | |||
预售定金:¥{{data.salePriceStr}} | |||
</view> | |||
</view> | |||
</view> | |||
<view class="coupons-btn" tt:if="{{mouldType!=1}}"> | |||
<!-- 优惠券价格 --> | |||
<i-button i-class=" coupons-btn-gm" tt:if="{{data.salePriceStr==0&&data.remainInventory!=0&&data.targetAd == 101}}" | |||
data-date='{{data}}'>免费领</i-button> | |||
<i-button i-class="coupons-btn-gm" | |||
tt:if="{{data.salePriceStr!=0&&data.remainInventory!=0&&data.targetAd == 101||data.salePriceStr!=0&&data.remainInventory!=0&&data.targetAd == 5}}" | |||
data-date='{{data}}'>购买</i-button> | |||
<i-button i-class="coupons-btn-gm" tt:if="{{data.remainInventory!=0&&data.targetAd == 2}}" data-date='{{data}}'> | |||
去抢购</i-button> | |||
<i-button i-class="coupons-btn-gm" tt:if="{{data.remainInventory!=0&&data.targetAd == 6}}" data-date='{{data}}'> | |||
去砍价</i-button> | |||
<i-button i-class="coupons-btn-gm" tt:if="{{data.remainInventory!=0&&data.targetAd == 7}}" data-date='{{data}}'> | |||
去拼团</i-button> | |||
<i-button i-class="coupons-btn-gms" tt:if="{{data.remainInventory==0}}" data-date='{{data}}'>已售罄</i-button> | |||
<i-button i-class="coupons-btn-gms" tt:if="{{data.status==1}}" data-date='{{data}}'>已下架</i-button> | |||
</view> | |||
<view class="coupons-btn" tt:if="{{mouldType==1}}"> | |||
<!-- 优惠券价格 --> | |||
<i-button i-class=" coupons-btn-gmX" tt:if="{{data.salePriceStr==0&&data.remainInventory!=0&&data.targetAd == 101}}" | |||
data-date='{{data}}'>免费领</i-button> | |||
<i-button i-class="coupons-btn-gmX" | |||
tt:if="{{data.salePriceStr!=0&&data.remainInventory!=0&&data.targetAd == 101||data.salePriceStr!=0&&data.remainInventory!=0&&data.targetAd == 5}}" | |||
data-date='{{data}}'>购买</i-button> | |||
<i-button i-class="coupons-btn-gmX" tt:if="{{data.remainInventory!=0&&data.targetAd == 2}}" data-date='{{data}}'> | |||
去抢购</i-button> | |||
<i-button i-class="coupons-btn-gmX" tt:if="{{data.remainInventory!=0&&data.targetAd == 6}}" data-date='{{data}}'> | |||
去砍价</i-button> | |||
<i-button i-class="coupons-btn-gmX" tt:if="{{data.remainInventory!=0&&data.targetAd == 7}}" data-date='{{data}}'> | |||
去拼团</i-button> | |||
<i-button i-class="coupons-btn-gms" tt:if="{{data.remainInventory==0}}" data-date='{{data}}'>已售罄</i-button> | |||
<i-button i-class="coupons-btn-gms" tt:if="{{data.status==1}}" data-date='{{data}}'>已下架</i-button> | |||
</view> | |||
</view> | |||
</view> |
@@ -0,0 +1,392 @@ | |||
@import "../../app.ttss"; | |||
.coupons { | |||
position: relative; | |||
width: 340rpx; | |||
display: inline-block; | |||
overflow: hidden; | |||
border-radius: 12rpx; | |||
} | |||
.earnest{ | |||
color: red; | |||
font-size: 24rpx; | |||
padding-left: 10rpx; | |||
} | |||
.coupons-border { | |||
height: 1rpx; | |||
left: 30rpx; | |||
right: 30rpx; | |||
background: #f5f5f5; | |||
position: absolute; | |||
bottom: 0; | |||
} | |||
.coupons-img image { | |||
display: block; | |||
width: 300rpx; | |||
height: 176rpx; | |||
margin: 20rpx auto 0; | |||
/* border-top-left-radius: 10rpx; | |||
border-top-right-radius: 10rpx; */ | |||
} | |||
.coupons-info { | |||
width: 90%; | |||
height: 152rpx; | |||
border-radius: 0rpx 0rpx 10rpx 10rpx; | |||
background: #fff; | |||
margin: 0 auto; | |||
} | |||
.coupons-info-name { | |||
font-size: 30rpx; | |||
color: #3c3c3c; | |||
letter-spacing: 0; | |||
line-height: 38rpx; | |||
} | |||
.coupons-info-price { | |||
padding: 16rpx 0 0; | |||
} | |||
.i { | |||
font-size: 24rpx; | |||
font-style: normal; | |||
} | |||
.coupons-info-price-p { | |||
display: inline-block; | |||
font-size: 50rpx; | |||
margin-bottom: 26rpx; | |||
width: 100%; | |||
} | |||
.price { | |||
font-size: 36rpx; | |||
font-family: PingFang-SC-Bold; | |||
font-weight: bold; | |||
line-height: 44rpx; | |||
margin-left: 16rpx; | |||
padding-top: 16rpx; | |||
color: #fd832d; | |||
width: 60%; | |||
overflow: hidden; | |||
white-space: nowrap; | |||
text-overflow: ellipsis; | |||
} | |||
.rmb { | |||
font-size: 24rpx !important; | |||
margin-right: 4rpx !important; | |||
color: #FD782D!; | |||
} | |||
.num { | |||
color: #fd782d; | |||
} | |||
.tit { | |||
overflow: hidden; | |||
white-space: nowrap; | |||
text-overflow: ellipsis; | |||
font-size: 28rpx; | |||
line-height: 32rpx; | |||
padding-top: 20rpx; | |||
padding-left: 10rpx; | |||
color: #333; | |||
letter-spacing: 0; | |||
} | |||
.coupons-info-price-o { | |||
display: block; | |||
text-align: center; | |||
font-size: 26rpx; | |||
color: #b4b4b4; | |||
letter-spacing: 0.96rpx; | |||
text-decoration: line-through; | |||
line-height: 24rpx; | |||
} | |||
.coupons-info-distance { | |||
font-size: 22rpx; | |||
color: #c0c0c0; | |||
letter-spacing: 0; | |||
padding-bottom: 10rpx; | |||
line-height: 30rpx; | |||
} | |||
.coupons-info-address { | |||
font-size: 22rpx; | |||
color: #585858; | |||
letter-spacing: 0; | |||
line-height: 30rpx; | |||
} | |||
.coupons-btn { | |||
position: absolute; | |||
bottom: 0rpx; | |||
right: 24rpx; | |||
} | |||
.coupons-btn-gm { | |||
border-radius: 10px !important; | |||
margin: 0 !important; | |||
padding: 0 !important; | |||
font-size: 26rpx; | |||
color: #fff !important; | |||
letter-spacing: 0; | |||
height: 51rpx !important; | |||
width: 100rpx !important; | |||
line-height: 51rpx !important; | |||
background: linear-gradient(127deg, rgba(252, 177, 74, 1) 0%, rgba(254, 70, 20, 1) 100%) !important; | |||
} | |||
.coupons-btn-gmX{ | |||
width: 116rpx !important; | |||
height: 52rpx !important; | |||
border-radius: 26rpx !important; | |||
line-height: 52rpx !important; | |||
background: linear-gradient(90deg, #E3BA79, #BC8D3E) !important; | |||
text-align: center !important; | |||
color: #feffff !important; | |||
font-family: "PingFangSC-Regular"; | |||
font-size: 26rpx !important; | |||
font-weight: 400 !important; | |||
margin: 0 !important; | |||
padding: 0 !important; | |||
} | |||
.coupons-btn-gms { | |||
background: #b9b9b9 !important; | |||
border-radius: 10px !important; | |||
opacity: 0.6; | |||
margin: 0 !important; | |||
padding: 0 !important; | |||
font-family: PingFangSC-Semibold; | |||
font-size: 26rpx; | |||
font-weight: 400; | |||
color: #fff !important; | |||
letter-spacing: 0; | |||
height: 51rpx !important; | |||
width: 100rpx !important; | |||
line-height: 51rpx !important; | |||
} | |||
.subtitle { | |||
font-size: 24rpx; | |||
color: #999; | |||
overflow: hidden; | |||
height: 24rpx; | |||
width: 65%; | |||
padding-left: 10rpx; | |||
line-height: 24rpx; | |||
white-space: nowrap; | |||
text-overflow: ellipsis; | |||
margin-top: 12rpx; | |||
} | |||
.coupons-info-manjian { | |||
font-weight: normal; | |||
font-size: 20rpx; | |||
line-height: 34rpx; | |||
display: inline-block; | |||
color: #ff4949; | |||
letter-spacing: 0; | |||
} | |||
.coupons-info-manjian1 { | |||
font-weight: normal; | |||
font-size: 20rpx; | |||
line-height: 22rpx; | |||
color: #919191; | |||
letter-spacing: 0; | |||
overflow: hidden; | |||
white-space: nowrap; | |||
text-overflow: ellipsis; | |||
width: 300rpx; | |||
margin-top: 16rpx; | |||
} | |||
.coupons-info-manjian text { | |||
display: block; | |||
line-height: 20rpx; | |||
} | |||
.coupons-info-manjian > text:nth-of-type(1) { | |||
display: block; | |||
/* color: #FF4949; */ | |||
opacity: 0.6; | |||
} | |||
.view02 { | |||
font-size: 20rpx; | |||
line-height: 34rpx; | |||
text-decoration: line-through; | |||
color: #999 !important; | |||
font-weight: normal; | |||
letter-spacing: 0; | |||
margin-left: 10rpx; | |||
} | |||
.view01 { | |||
text-decoration: line-through; | |||
color: #999 !important; | |||
} | |||
.txt2 { | |||
display: block; | |||
color: #ccc; | |||
} | |||
/**上拉加载更多**/ | |||
.userinfo { | |||
display: flex; | |||
flex-direction: column; | |||
align-items: center; | |||
} | |||
.userinfo-avatar { | |||
width: 128rpx; | |||
height: 128rpx; | |||
margin: 20rpx; | |||
border-radius: 50%; | |||
} | |||
.fuhaoX{ | |||
color: #d5af67; | |||
font-family: "PingFangSC-Medium"; | |||
font-size: 34rpx; | |||
font-weight: 400; | |||
float: left; | |||
margin-top: 5rpx | |||
} | |||
.userinfo-nickname { | |||
color: #aaa; | |||
} | |||
.sy { | |||
display: block; | |||
text-align: right; | |||
width: 181rpx; | |||
font-size: 24rpx; | |||
color: #999; | |||
height: 40rpx; | |||
margin-top: 106rpx; | |||
} | |||
.usermotto { | |||
margin-top: 200px; | |||
} | |||
scroll-view { | |||
width: 100%; | |||
} | |||
.item { | |||
width: 90%; | |||
height: 300rpx; | |||
margin: 20rpx auto; | |||
background: brown; | |||
overflow: hidden; | |||
} | |||
.item .img { | |||
width: 430rpx; | |||
margin-right: 20rpx; | |||
float: left; | |||
} | |||
.title { | |||
font-size: 30rpx; | |||
display: block; | |||
margin: 30rpx auto; | |||
} | |||
.description { | |||
font-size: 26rpx; | |||
line-height: 15rpx; | |||
} | |||
.navigator-hover { | |||
opacity: 1 !important; | |||
background: #fff; | |||
} | |||
.hover { | |||
opacity: 0.6; | |||
} | |||
.navigator { | |||
display: inline-block; | |||
background: #fff; | |||
border-radius: 12rpx; | |||
position: relative; | |||
} | |||
.presell { | |||
position: absolute; | |||
width: 300rpx; | |||
height: 40rpx; | |||
background-color: rgba(247, 21, 21, 0.6); | |||
z-index: 100; | |||
top: 158rpx; | |||
line-height: 20px; | |||
text-align: center; | |||
color: #fff; | |||
margin-left: 20rpx; | |||
font-size: 26rpx; | |||
} | |||
.superscript { | |||
position: absolute; | |||
top: -10rpx; | |||
left: -12rpx; | |||
width: 86rpx; | |||
height: 86rpx; | |||
overflow: hidden; | |||
} | |||
/* 使用背景色渐变 */ | |||
.superscript .gradual { | |||
width: 100%; | |||
height: 100%; | |||
background: linear-gradient(135deg, #31b968 50%, transparent 50%); | |||
} | |||
/* 使用三角形 */ | |||
.superscript .triangle { | |||
width: 0; | |||
height: 0; | |||
border-top: 130rpx solid #31b968; | |||
border-right: 130rpx solid transparent; | |||
} | |||
/* 使用矩形旋转, 和父节点的 overflow:hidden 配合 */ | |||
.superscript .rect { | |||
width: 176rpx; | |||
height: 183rpx; | |||
margin: -91rpx 0 0 -91rpx; | |||
transform: rotateZ(45deg); | |||
} | |||
.superscript .desc { | |||
position: absolute; | |||
top: 29%; | |||
left: 16%; | |||
z-index: 1; | |||
color: #fff; | |||
font-size: 23rpx; | |||
transform: rotate(-45deg); | |||
} | |||
.saleprice { | |||
font-size: 24rpx; | |||
display: inline-block; | |||
margin-right: 10rpx; | |||
font-weight: 400; | |||
} |
@@ -0,0 +1,121 @@ | |||
const config = require("../../config/config"); | |||
const Http = require("../../utils/HttpBasics"); | |||
// d:\fumaolianke\ttFmC\tt富茂C\components\getPhoen\getPhoen.js | |||
Component({ | |||
data: { | |||
phone: "", | |||
auth: "", | |||
time: "获取验证码", | |||
verFlag: true, | |||
currentTime: 61, | |||
setInter: '' | |||
}, | |||
properties: { | |||
type: Boolean, | |||
showBox: false | |||
}, | |||
methods: { | |||
getCode() { | |||
var that = this; | |||
var currentTime = that.data.currentTime | |||
that.data.setInter = setInterval(function () { | |||
currentTime--; | |||
that.setData({ | |||
time: currentTime + '秒' | |||
}) | |||
if (currentTime <= 0) { | |||
clearInterval(that.data.setInter) | |||
that.setData({ | |||
time: '获取验证码', | |||
currentTime: 61, | |||
verFlag: true | |||
}) | |||
} | |||
}, 1000) | |||
}, | |||
setPhone(e) { | |||
this.setData({ | |||
phone: e.detail.value | |||
}) | |||
}, | |||
setAuth(e) { | |||
this.setData({ | |||
auth: e.detail.value | |||
}) | |||
}, | |||
verify() { | |||
let phoneReg = /(^1[3|4|5|7|8]\d{9}$)|(^09\d{8}$)/; | |||
if (!this.data.verFlag) { | |||
return | |||
} | |||
if (phoneReg.test(this.data.phone)) { | |||
Http.get({ | |||
url: config.api.sendValidationCode, | |||
data: { | |||
phone: this.data.phone, | |||
type:6 | |||
} | |||
}).then(res => { | |||
console.log(res, "res"); | |||
this.setData({ | |||
verFlag: false | |||
}) | |||
this.getCode() | |||
}).catch(err => { | |||
tt.showToast({ | |||
title: err.message ? err.message : err.data, // 内容 | |||
icon: "none" | |||
}); | |||
}) | |||
} else { | |||
tt.showToast({ | |||
title: '手机号有误', | |||
icon: "none", | |||
}) | |||
} | |||
}, | |||
hieBox(){ | |||
this.triggerEvent("heiBox" ,false) | |||
}, | |||
hiePhoen(){ | |||
this.triggerEvent("hiePhoen" ,false) | |||
}, | |||
send() { | |||
let phoneReg = /(^1[3|4|5|7|8]\d{9}$)|(^09\d{8}$)/; | |||
if (phoneReg.test(this.data.phone)) { | |||
console.log(this.data.auth); | |||
if(this.data.auth!=""){ | |||
Http.get({ | |||
url: config.api.validationCode, | |||
data: { | |||
phone: this.data.phone, | |||
code: this.data.auth, | |||
type:6 | |||
} | |||
}).then(res => { | |||
this.hiePhoen() | |||
}).catch(err => { | |||
tt.showToast({ | |||
title: err.message ? err.message : err.data, // 内容 | |||
icon: "none" | |||
}); | |||
}) | |||
}else{ | |||
tt.showToast({ | |||
title: '请输入验证码', | |||
icon: "none", | |||
}) | |||
} | |||
} else { | |||
tt.showToast({ | |||
title: '手机号有误', | |||
icon: "none", | |||
}) | |||
} | |||
} | |||
} | |||
}) |
@@ -0,0 +1,4 @@ | |||
{ | |||
"component": true, | |||
"usingComponents": {} | |||
} |
@@ -0,0 +1,29 @@ | |||
<view class="box" tt:if="{{showBox}}"> | |||
<view class="phoneBox"> | |||
<view class="hiePhone"> | |||
<view class="f">授权手机号</view> | |||
<view class="r" bindtap="hieBox" > | |||
<image src="../../assets/itemImg/phDel.png" style="width: 100%;height: 100%;"/> | |||
</view> | |||
</view> | |||
<view class="userPhone"> | |||
<input | |||
type="number" | |||
placeholder="请输入手机号码" | |||
bindinput="setPhone" | |||
value = "{{phone}}" | |||
class="inputPhone" | |||
/> | |||
<view class="btn" bindtap="verify">{{time}}</view> | |||
</view> | |||
<input | |||
type="number" | |||
placeholder="请输入验证码" | |||
bindinput="setAuth" | |||
value="{{auth}}" | |||
class="auth" | |||
/> | |||
<view class="send" bindtap="send">授权手机号</view> | |||
</view> | |||
</view> |
@@ -0,0 +1,95 @@ | |||
.box{ | |||
width: 100%; | |||
height: 100vh; | |||
position: fixed; | |||
top: 0; | |||
left: 0; | |||
background: rgba(0, 0, 0, 0.3); | |||
z-index: 100000; | |||
} | |||
.phoneBox{ | |||
position: absolute; | |||
width: 80%; | |||
/* height: 200rpx; */ | |||
border-radius: 12rpx; | |||
background-color: #f6f6f6; | |||
transform: translate(-50%, -50%); | |||
top: 50%; | |||
left: 50%; | |||
overflow: hidden; | |||
} | |||
.userPhone{ | |||
overflow: hidden; | |||
margin: 20rpx ; | |||
} | |||
.inputPhone{ | |||
float: left; | |||
text-indent: 40rpx; | |||
font-size: 28rpx; | |||
color: #000; | |||
letter-spacing: 0; | |||
margin-top: 28rpx; | |||
width: 50%; | |||
display: block; | |||
} | |||
.btn{ | |||
width: 210rpx !important; | |||
border-radius: 16rpx; | |||
margin-top: 12rpx; | |||
margin-right: 30rpx; | |||
font-size: 30rpx!important; | |||
letter-spacing: 0; | |||
padding: 0!important; | |||
float: right; | |||
height: 80rpx; | |||
line-height: 80rpx; | |||
background: #52a0fd; | |||
color: #fff; | |||
text-align: center; | |||
} | |||
.auth{ | |||
width: 50%; | |||
text-indent: 40rpx; | |||
font-size: 28rpx; | |||
color: #000; | |||
letter-spacing: 0; | |||
margin: 20rpx; | |||
} | |||
.send{ | |||
width: 80%; | |||
line-height: 80rpx; | |||
height: 80rpx; | |||
background: #52a0fd; | |||
color: #fff; | |||
font-size: 36rpx; | |||
text-align: center; | |||
margin: 40rpx auto 20rpx auto; | |||
border-radius: 12rpx; | |||
font-size: 30rpx; | |||
} | |||
.hiePhone{ | |||
width: 80%; | |||
margin: 10rpx auto; | |||
overflow: hidden; | |||
} | |||
.f{ | |||
float: left; | |||
font-size: 30rpx; | |||
height: 60rpx; | |||
line-height: 60rpx; | |||
margin-left: 30%; | |||
} | |||
.r{ | |||
width: 40rpx; | |||
height: 40rpx; | |||
/* line-height: 60rpx; */ | |||
text-align: center; | |||
float: right; | |||
margin-top: 10rpx; | |||
/* font-size: 30rpx; */ | |||
} | |||
input{ | |||
text-align: left; | |||
} |
@@ -0,0 +1,142 @@ | |||
// pages/index/sw/index.js | |||
let config = require("../../config/config.js"); | |||
let Http = require("../../utils/HttpBasics"); | |||
let app = getApp(); | |||
const imgurl = require("../../utils/imgurl"); | |||
const bgColor = require("../../utils/bgColor.js") | |||
Component({ | |||
/** | |||
* 组件的属性列表 | |||
*/ | |||
properties: {}, | |||
/** | |||
* 组件的初始数据 | |||
*/ | |||
data: { | |||
sql: bgColor.colorFirst.main.sql, | |||
txt: bgColor.colorFirst.main.txt, | |||
change: imgurl.change.url, | |||
None: imgurl.None.url, | |||
jianUrl: imgurl.jian.url, | |||
barginicon: imgurl.barginicon.url, | |||
wangmeimeibargin: imgurl.wangmeimeibargin.url, | |||
kData:[], | |||
kSize:'', | |||
pSize: '', | |||
pData:[], | |||
couponId:'', | |||
couponId1: '', | |||
}, | |||
/** | |||
* 组件的方法列表 | |||
*/ | |||
methods: { | |||
//获取砍价拼团数据 | |||
getList(val) { | |||
let that = this; | |||
let param = '' | |||
if(val=='1'){ | |||
param={ | |||
targetAd : 6, | |||
couponId: this.data.couponId | |||
} | |||
}else{ | |||
param = { | |||
targetAd : 7, | |||
couponId: this.data.couponId1 | |||
} | |||
} | |||
Http.get({ | |||
url: config.api.change, | |||
data:param, | |||
}).then(res => { | |||
if(res.data != undefined && res.data){ | |||
if(val=='1'){ | |||
that.setData({ | |||
kData: res.data.data, | |||
kSize: res.data.size, | |||
couponId: res.data.data.couponId, | |||
}); | |||
}else{ | |||
that.setData({ | |||
pData: res.data.data, | |||
pSize:res.data.size, | |||
couponId1: res.data.data.couponId | |||
}); | |||
} | |||
} else { | |||
if(val=='1'){ | |||
that.setData({ | |||
kData: '', | |||
kSize: '', | |||
couponId: '', | |||
}); | |||
}else{ | |||
that.setData({ | |||
pData: '', | |||
pSize:'', | |||
couponId1: '' | |||
}); | |||
} | |||
} | |||
}) | |||
.catch(err => { | |||
console.log(err) | |||
tt.showToast({ | |||
title: err.errMsg, | |||
icon: 'none', | |||
duration: 2000, | |||
mask: false | |||
}); | |||
}) | |||
}, | |||
// 换一换 | |||
getChange(){ | |||
let that = this | |||
if (that.kSize != 1 && that.kSize != 0){ | |||
that.getList(1) | |||
} | |||
if (that.pSize!=1 && that.pSize !=0) { | |||
that.getList(2) | |||
} | |||
}, | |||
//跳转砍价详情 | |||
gotokjdetail: function (e) { | |||
tt.navigateTo({ | |||
url: `/pages/coupon/detail/index?couponChannelId=${ | |||
e.currentTarget.dataset.couponchannelid | |||
}&couponId=${ | |||
e.currentTarget.dataset.couponid | |||
}&targetAd=${ | |||
e.currentTarget.dataset.targetad | |||
}` | |||
}); | |||
}, | |||
//跳转拼团详情 | |||
gotoptdetail: function (e) { | |||
tt.navigateTo({ | |||
url: `/pages/spellGroup/mySpellGroup/index?couponChannelId=${ | |||
e.currentTarget.dataset.couponchannelid | |||
}&couponId=${ | |||
e.currentTarget.dataset.couponid | |||
}&targetAd=${ | |||
e.currentTarget.dataset.targetad | |||
}` | |||
}); | |||
}, | |||
}, | |||
ready() { | |||
app.couponChannelListCallback = (token,val) => { | |||
Http.setToken(token); | |||
this.getList(1); | |||
this.getList(2); | |||
}; | |||
if (app.globalData.token && app.globalData.token != null) { | |||
app.couponChannelListCallback(app.globalData.token); | |||
} | |||
} | |||
}); |
@@ -0,0 +1,4 @@ | |||
{ | |||
"component": true, | |||
"usingComponents": {} | |||
} |
@@ -0,0 +1,61 @@ | |||
<view class='hotBox'> | |||
<view class='hotTitle'> | |||
<view class='titleL'> | |||
<view class='sql' style='background:{{sql}}'></view> | |||
<text>爆款专区</text> | |||
</view> | |||
<view class='titleR' bindtap='getChange' tt:if="{{pSize>=2||kSize>=2}}"> | |||
<text style='color:{{txt}}'>换一换</text> | |||
<view> | |||
<image src='{{change}}' bindtap='' mode='aspectFill'></image> | |||
</view> | |||
</view> | |||
</view> | |||
<view class='hotCon clearfix'> | |||
<view class='kanjia' tt:if="{{kSize}}" bindtap="gotokjdetail" data-couponId='{{kData.couponId}}' | |||
data-couponChannelId="{{kData.id}}" data-targetAd="{{kData.targetAd}}"> | |||
<view> | |||
<image mode='aspectFill' lazy-load='true' src="{{kData.coverImg}}" /> | |||
</view> | |||
<view class='kjText'> | |||
<text class='title'>{{kData.title}}</text> | |||
<text class='price'>¥{{kData.priceStr}}</text> | |||
<text class='sale'><text>¥</text>{{kData.salePriceStr}}</text> | |||
<view class=' btn btnk'>砍价</view> | |||
</view> | |||
</view> | |||
<view class='kanjia' tt:if="{{!kSize}}"> | |||
<view> | |||
<image src='{{None}}' bindtap='' mode='aspectFill'></image> | |||
</view> | |||
<view class='kjText'> | |||
<text class='title'>疯狂补货中…</text> | |||
<text class='expect'>敬请期待</text> | |||
<view class='btnk btnNone'>砍价</view> | |||
</view> | |||
</view> | |||
<view class='pintuan' tt:if="{{pSize}}" bindtap="gotoptdetail" data-couponId='{{pData.couponId}}' | |||
data-couponChannelId="{{pData.id}}" data-targetAd="{{pData.targetAd}}"> | |||
<view> | |||
<image mode='aspectFill' lazy-load='true' src="{{pData.coverImg}}" /> | |||
</view> | |||
<view class='ptText'> | |||
<text class='title'>{{pData.title}}</text> | |||
<text class='price'>¥{{pData.priceStr}}</text> | |||
<text class='sale'> <text>¥</text>{{pData.salePriceStr}}</text> | |||
<view class='btn btnp'>拼团</view> | |||
</view> | |||
</view> | |||
<view class='pintuan' tt:if="{{!pSize}}"> | |||
<view> | |||
<image src='{{None}}' bindtap='' mode='aspectFill'></image> | |||
</view> | |||
<view class='ptText'> | |||
<text class='title'>疯狂补货中...</text> | |||
<text class='expect'>敬请期待</text> | |||
<view class='btnp btnNone'>拼团</view> | |||
</view> | |||
</view> | |||
</view> | |||
</view> |
@@ -0,0 +1,133 @@ | |||
@import "../../app.ttss"; | |||
.hotBox{ | |||
width:710rpx; | |||
margin: 0 auto ; | |||
} | |||
.hotTitle{ | |||
width: 100%; | |||
height: 60rpx; | |||
line-height: 60rpx; | |||
font-size: 30rpx; | |||
display: flex; | |||
justify-content: space-between; | |||
font-family:PingFangSC-Medium; | |||
} | |||
.titleL .titleR{ | |||
width: 100rpx; | |||
} | |||
.titleR text{ | |||
float: left; | |||
margin-right: 10rpx; | |||
font-family:PingFangSC-Regular!important; | |||
} | |||
.titleR view{ | |||
height: 40rpx; | |||
width: 40rpx; | |||
/* margin-top: 10rpx; */ | |||
float: left; | |||
} | |||
.titleR image{ | |||
height: 28rpx; | |||
width: 28rpx; | |||
} | |||
.sql{ | |||
width:12rpx; | |||
height:24rpx; | |||
border-radius:8rpx; | |||
float: left; | |||
margin: 20rpx 10rpx 0 0; | |||
} | |||
.hotCon{ | |||
width: 100%; | |||
} | |||
.kanjia, .pintuan{ | |||
width: 346rpx; | |||
height: 156rpx; | |||
float: left; | |||
border-radius: 12rpx; | |||
display: flex; | |||
justify-content: space-between; | |||
position: relative; | |||
} | |||
.kanjia{ | |||
margin-right: 18rpx; | |||
background:linear-gradient(130deg,rgba(50,177,252,1) 0%,rgba(47,108,255,1) 100%); | |||
} | |||
.pintuan{ | |||
background:linear-gradient(127deg,rgba(252,177,74,1) 0%,rgba(254,70,20,1) 100%); | |||
} | |||
.hotCon image{ | |||
width: 86rpx; | |||
height: 86rpx; | |||
margin: 24rpx 0 46rpx 16rpx; | |||
} | |||
.hotCon .btn{ | |||
width:80rpx; | |||
height:44rpx; | |||
line-height: 44rpx; | |||
background:rgba(255,255,255,1); | |||
border-radius:18rpx; | |||
font-size: 24rpx; | |||
position: absolute; | |||
right: 20rpx; | |||
bottom: 20rpx; | |||
text-align: center; | |||
} | |||
.btnk{ | |||
color: #2C8DFF; | |||
} | |||
.btnp{ | |||
color: #FD782D; | |||
} | |||
.btnNone{ | |||
width:80rpx; | |||
height:44rpx; | |||
line-height: 44rpx; | |||
border-radius:18rpx; | |||
font-size: 24rpx; | |||
position: absolute; | |||
right: 20rpx; | |||
bottom: 20rpx; | |||
text-align: center; | |||
background:rgba(255,255,255,0.5) | |||
} | |||
.kjText,.ptText{ | |||
color: #FFFFFF; | |||
margin: 14rpx 10rpx 20rpx 10rpx; | |||
} | |||
.title{ | |||
width: 210rpx; | |||
font-size: 30rpx; | |||
overflow: hidden; | |||
text-overflow:ellipsis; | |||
white-space:nowrap; | |||
float: left; | |||
} | |||
.price{ | |||
width: 128rpx; | |||
overflow: hidden; | |||
text-overflow:ellipsis; | |||
white-space:nowrap; | |||
font-size: 22rpx; | |||
text-decoration:line-through; | |||
float: left; | |||
} | |||
.expect{ | |||
width: 210rpx; | |||
font-size: 22rpx; | |||
float: left; | |||
} | |||
.sale{ | |||
width: 140rpx; | |||
font-size: 32rpx; | |||
float: left; | |||
margin-top: -8rpx; | |||
white-space: nowrap; | |||
text-overflow: ellipsis; | |||
overflow: hidden; | |||
} | |||
.sale text{ | |||
font-size: 20rpx!important; | |||
} |
@@ -0,0 +1 @@ | |||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="128px" height="128.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#202020" d="M711.1 928.3c-13.2 0-26.3-5-36.4-15.2L297.8 532.9c-20.1-20.2-20.1-53.1 0-73.3L674.7 79.2c20.1-20.3 52.6-20.3 72.7 0 20.1 20.2 20.1 53.1 0 73.3L406.9 496.2l340.5 343.6c20.1 20.3 20.1 53.1 0 73.3-10 10.1-23.2 15.2-36.3 15.2z" /></svg> |
@@ -0,0 +1 @@ | |||
<?xml version="1.0" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg class="icon" width="128px" height="128.00px" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg"><path fill="#202020" d="M962.986667 480.426667l-422.4-379.733334a42.666667 42.666667 0 0 0-57.173334 0l-422.4 379.733334a42.666667 42.666667 0 0 0 57.173334 63.146666l9.813333-8.533333V896a42.666667 42.666667 0 0 0 42.666667 42.666667h682.666666a42.666667 42.666667 0 0 0 42.666667-42.666667v-360.96l9.813333 8.533333a42.666667 42.666667 0 0 0 28.586667 11.093334 42.666667 42.666667 0 0 0 31.573333-14.08 42.666667 42.666667 0 0 0-2.986666-60.16zM469.333333 853.333333v-170.666666h85.333334v170.666666z m341.333334-384v384h-170.666667v-213.333333a42.666667 42.666667 0 0 0-42.666667-42.666667h-170.666666a42.666667 42.666667 0 0 0-42.666667 42.666667v213.333333H213.333333v-384a61.013333 61.013333 0 0 0 0-9.386666l298.666667-270.08 298.666667 270.08a61.013333 61.013333 0 0 0 0 9.386666z" /></svg> |
@@ -0,0 +1,84 @@ | |||
const app = getApp() | |||
Component({ | |||
properties: { | |||
background: { | |||
type: String, | |||
value: '#F4F5F9' | |||
}, | |||
color: { | |||
type: String, | |||
value: '#000' | |||
}, | |||
text: { | |||
type: String, | |||
value: 'Wechat' | |||
}, | |||
showLocationIf: { | |||
type: Boolean, | |||
value: false | |||
}, | |||
back: { | |||
type: Boolean, | |||
value: false | |||
}, | |||
home: { | |||
type: Boolean, | |||
value: false | |||
} | |||
}, | |||
data: { | |||
array: ['A广场', 'B广场-北京西单'], | |||
index: 1, | |||
statusBarHeight: app.statusBarHeight + 'px', | |||
navigationBarHeight: (app.statusBarHeight + 44) + 'px', | |||
indexFlaig:null, | |||
}, | |||
methods: { | |||
backHome: function () { | |||
app.globalData.selected = 0 | |||
let tempUrl = '/index/index' | |||
tt.reLaunch({ | |||
url: tempUrl, | |||
success(res) { | |||
console.log(`${res}`); | |||
}, | |||
fail(err) { | |||
console.log(`navigateTo调用失败`,err,tempUrl); | |||
}, | |||
}); | |||
}, | |||
bindPickerChange: function (e) { | |||
console.log('picker发送选择改变,携带值为', e.detail.value) | |||
this.setData({ | |||
index: e.detail.value | |||
}) | |||
}, | |||
back:function() { | |||
tt.navigateBack({ | |||
delta: 1, | |||
success(res) { | |||
console.log(`${res}`); | |||
}, | |||
fail(err) { | |||
console.log(`navigateTo调用失败`,err); | |||
}, | |||
}) | |||
} | |||
}, | |||
attached: function(){ | |||
this.setData({ | |||
indexFlaig:app.globalData.selected | |||
}) | |||
console.log(this.properties); | |||
let pages = getCurrentPages(); | |||
console.log(pages.length); | |||
if (pages.length <= 1) { | |||
this.setData({ | |||
back: false | |||
}) | |||
} | |||
} | |||
}) |
@@ -0,0 +1,3 @@ | |||
{ | |||
"component": true | |||
} |
@@ -0,0 +1,20 @@ | |||
<view class="navbar" style="background:{{background}}!important;"> | |||
<view style="{{'height: ' + statusBarHeight}}"></view> | |||
<view class='title-container'> | |||
<view class='capsule' tt:if="{{ back || home}}"> | |||
<view bindtap='back' tt:if="{{ back}}" > | |||
<image style="left:36%;" src='img/back.svg'></image> | |||
</view> | |||
<view bindtap='backHome' tt:if="{{home}}"> | |||
<image src='img/home.svg' style="width:90%;"></image> | |||
</view> | |||
</view> | |||
<view class='title' style="color:{{color}}!important">{{text}}</view> | |||
<picker bindchange="bindPickerChange" tt:if="{{showLocationIf}}" class="pick-box" value="{{index}}" range="{{array}}"> | |||
<icon class='iconfont icon-daohangdizhiweizhi'></icon> | |||
<view class="picker locations"> | |||
{{array[index]}} | |||
</view> | |||
</picker> | |||
</view> | |||
</view> |
@@ -0,0 +1,92 @@ | |||
.navbar { | |||
width: 100vw; | |||
background-color: #F4F5F9; | |||
position: fixed; | |||
left: 0; | |||
top: 0; | |||
/* height:150rpx; */ | |||
overflow: hidden; | |||
z-index: 400000000; | |||
} | |||
.title-container { | |||
height: 50px; | |||
display: flex; | |||
align-items: center; | |||
position: relative; | |||
} | |||
.capsule { | |||
margin-left: 10px; | |||
height: 32px; | |||
border: 1px solid #e1e1e3; | |||
border-radius: 60px; | |||
display: flex; | |||
align-items: center; | |||
padding: 0 20rpx; | |||
background: #fff!important; | |||
} | |||
.capsule > view { | |||
width: 35px; | |||
height: 60%; | |||
position: relative; | |||
} | |||
.capsule > view:nth-child(2) { | |||
border-left: 1px solid #777; | |||
} | |||
.capsule image { | |||
width: 70%; | |||
height: 100%; | |||
position: absolute; | |||
left: 50%; | |||
top: 50%; | |||
transform: translate(-50%,-50%); | |||
} | |||
.title { | |||
color: #000; | |||
position: absolute; | |||
left: 104px; | |||
right: 104px; | |||
font-weight: 600; | |||
font-size: 32rpx; | |||
text-align: center; | |||
overflow: hidden; | |||
text-overflow: ellipsis; | |||
white-space: nowrap; | |||
} | |||
@font-face { | |||
font-family: 'iconfont'; /* project id 1353695 */ | |||
src: url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.eot'); | |||
src: url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.eot?#iefix') format('embedded-opentype'), | |||
url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.woff2') format('woff2'), | |||
url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.woff') format('woff'), | |||
url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.ttf') format('truetype'), | |||
url('//at.alicdn.com/t/font_1353695_nyv2ld9xqk8.svg#iconfont') format('svg'); | |||
} | |||
.iconfont { | |||
font-family: "iconfont" !important; | |||
font-size: 16px; | |||
font-style: normal; | |||
-webkit-font-smoothing: antialiased; | |||
-moz-osx-font-smoothing: grayscale; | |||
} | |||
.icon-daohangdizhiweizhi:before { | |||
content: "\e787"; | |||
} | |||
.locations{ | |||
font-size: 28rpx; | |||
display: inline-block; | |||
width: 200rpx; | |||
overflow: hidden; | |||
text-overflow:ellipsis; | |||
white-space: nowrap; | |||
} | |||
.pick-box{ | |||
width: 260rpx; | |||
padding-left: 20rpx; | |||
} |
@@ -0,0 +1,56 @@ | |||
// components/optimization/optimization.js | |||
Component({ | |||
/** | |||
* 组件的属性列表 | |||
*/ | |||
properties: { | |||
businessList:{ | |||
type:Array, | |||
value:[] | |||
}, | |||
businessData: { | |||
type: Array, | |||
value: [] | |||
}, | |||
}, | |||
/** | |||
* 组件的初始数据 | |||
*/ | |||
data: { | |||
classIndex:0 | |||
}, | |||
/** | |||
* 组件的方法列表 | |||
*/ | |||
methods: { | |||
goDetail(e){ | |||
let couponChannelId = e.currentTarget.dataset.id | |||
let couponId = e.currentTarget.dataset.couponid | |||
tt.navigateTo({ | |||
url: `/pages/coupon/detail/index?couponChannelId=${couponChannelId}&couponId=${couponId}`, | |||
}) | |||
}, | |||
setIndex(e){ | |||
let index = e.currentTarget.dataset.index | |||
let id = e.currentTarget.dataset.id | |||
this.triggerEvent('businessid',id) | |||
this.setData({ | |||
classIndex:index | |||
}) | |||
}, | |||
goLsit(){ | |||
tt.navigateTo({ | |||
url: '/pages/liveLsit/liveLsit', | |||
success: (res) => { | |||
}, | |||
fail: (res) => { | |||
}, | |||
}); | |||
} | |||
} | |||
}) |
@@ -0,0 +1,4 @@ | |||
{ | |||
"component": true, | |||
"usingComponents": {} | |||
} |
@@ -0,0 +1,55 @@ | |||
<view class="optimizationBox"> | |||
<view class="titleImg"> | |||
<view class="textl f">优选好物</view> | |||
<view class="textr r">Preferred Good</view> | |||
</view> | |||
<view class="classifyBox-go-box"> | |||
<view class="classifyBox"> | |||
<view class="itemBox" tt:for="{{businessList}}" tt:key="{{index}}" bindtap="setIndex" data-index="{{index}}" data-id="{{item.id}}"> | |||
<view class="{{classIndex==index?'className_a':'className'}}">{{item.title}}</view> | |||
<view class="xian" tt:if="{{classIndex==index}}"></view> | |||
</view> | |||
</view> | |||
<!-- <view class="goLsit" bindtap="goLsit"> 直播商品 <image class="rup" src="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_icon_jt.png"></image></view> --> | |||
</view> | |||
<view class="contBox"> | |||
<view class="contLsitBox"> | |||
<view class="item" tt:for="{{businessData}}" tt:key="{{index}}" bindtap="goDetail" data-couponid="{{item.couponId}}" data-id="{{item.id}}"> | |||
<view class="itemImg"> | |||
<image src="{{item.coverImg}}" mode='scaleToFill'></image> | |||
</view> | |||
<view class="titleName">{{item.title}}</view> | |||
<!-- <view class="priceBox"> | |||
<view class="sellingBox f"> | |||
<view class="fuhao">¥</view> | |||
<view class="int">{{item.salePriceStrQ?item.salePriceStrQ:item.salePriceStr}}</view> | |||
<view class="fuhao">{{item.salePriceStrH?'.'+item.salePriceStrH:''}}</view> | |||
</view> | |||
<view class="priceNum r">已售 {{item.sale}}</view> | |||
<view class="originalBox r"> | |||
<view class="origina">¥{{item.priceStr}}</view> | |||
</view> | |||
</view> --> | |||
<view class="priceBox"> | |||
<view class="sellingBox f"> | |||
<view class="fuhaoX">¥{{item.salePriceStr?item.salePriceStr:""}} </view> | |||
</view> | |||
<view class="r btn">马上抢</view> | |||
</view> | |||
<view class="sellout" tt:if="{{item.remainInventory==0}}"> | |||
<image class="selloutImg" src="https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_img_ysx.png"></image> | |||
</view> | |||
</view> | |||
</view> | |||
</view> | |||
</view> |
@@ -0,0 +1,247 @@ | |||
.optimizationBox { | |||
/* overflow: hidden; */ | |||
margin-top: 20rpx; | |||
margin-bottom: 100rpx; | |||
} | |||
.titleImg { | |||
width: 96%; | |||
height: 80rpx; | |||
margin: 0rpx auto; | |||
background-image: url("https://formall.oss-accelerate.aliyuncs.com/cimg/v20211214/home_ggw_yxhw.png"); | |||
background-size: 100% 100%; | |||
background-repeat: no-repeat; | |||
} | |||
.textl { | |||
font-size: 34rpx; | |||
font-family: OPPOSans; | |||
font-weight: bold; | |||
color: #dfbe99; | |||
margin: 20rpx; | |||
} | |||
.textr { | |||
font-size: 30rpx; | |||
font-family: OPPOSans; | |||
font-weight: 300; | |||
color: #91897e; | |||
margin: 20rpx; | |||
} | |||
.f { | |||
float: left; | |||
} | |||
.r { | |||
float: right; | |||
} | |||
.classifyBox-go-box{ | |||
background-color: #fff; | |||
} | |||
.classifyBox { | |||
width: 100%; | |||
border-radius: 20rpx 20rpx 0 0; | |||
background-color: #fff; | |||
overflow: hidden; | |||
display: -webkit-box; | |||
overflow-x: scroll; | |||
-webkit-overflow-scrolling: touch; | |||
/* margin: 10rpx 0; *//* background: linear-gradient(0deg, #F5F5F5, #fff); */ | |||
float: left; | |||
} | |||
.goLsit{ | |||
width: 20%; | |||
float: left; | |||
font-size: 28rpx; | |||
color: #454340; | |||
margin: 20rpx 0 10rpx 0; | |||
} | |||
.classifyBox::-webkit-scrollbar { | |||
display: none; | |||
} | |||
.rup{ | |||
width: 13rpx; | |||
height: 20rpx; | |||
margin: 2rpx 0 0 6rpx; | |||
} | |||
.itemBox { | |||
width: 100rpx; | |||
height: 100rpx; | |||
margin: 0 20rpx; | |||
} | |||
.className { | |||
font-size: 28rpx; | |||
font-family: OPPOSans; | |||
font-weight: 500; | |||
color: #454340; | |||
text-align: center; | |||
margin: 20rpx auto 10rpx auto; | |||
} | |||
.className_a { | |||
font-size: 30rpx; | |||
font-family: OPPOSans; | |||
font-weight: 800; | |||
color: #c99f67; | |||
text-align: center; | |||
background: linear-gradient(180deg, #cc9a60 0%, #dfbf8e 100%); | |||
-webkit-background-clip: text; | |||
-webkit-text-fill-color: transparent; | |||
margin: 20rpx auto 10rpx auto; | |||
} | |||
.xian{ | |||
width: 22rpx; | |||
height: 5rpx; | |||
background: linear-gradient(180deg, #D5A56E, #E9D0AA); | |||
border-radius: 3px; | |||
margin: 0 auto; | |||
} | |||
.contBox{ | |||
background: linear-gradient(0deg, #F5F5F5, rgba(255, 255, 255, 0.5)); | |||
/* height: 350rpx; */ | |||
} | |||
.contLsitBox{ | |||
width: 96%; | |||
margin: 0 auto; | |||
display: flex; | |||
overflow: hidden; | |||
justify-content: space-between; | |||
flex-wrap: wrap; | |||
} | |||
.item{ | |||
width: 49%; | |||
background-color: #fff; | |||
border-radius: 20rpx; | |||
margin: 12rpx 0; | |||
position: relative; | |||
} | |||
.itemImg{ | |||
width: 100%; | |||
height: 350rpx; | |||
border-radius: 20rpx; | |||
/* background-color: aquamarine; */ | |||
} | |||
.itemImg image{ | |||
width: 100%; | |||
height: 100%; | |||
border-radius: 20rpx 20rpx 0 0; | |||
} | |||
.titleName{ | |||
color: #402e1e; | |||
font-size: 30rpx; | |||
font-family: "PingFangSC-Regular"; | |||
font-weight: 400; | |||
width: 100%; | |||
font-size: 28rpx; | |||
width:90%; | |||
height: 80rpx; | |||
font-size: 28rpx; | |||
/* font-family: OPPOSans; */ | |||
/* font-weight: 500; */ | |||
/* color: #333333; */ | |||
margin: 10rpx auto 0 auto; | |||
overflow: hidden; | |||
text-overflow: ellipsis; | |||
display: -webkit-box; | |||
-webkit-line-clamp: 2; | |||
-webkit-box-orient: vertical; | |||
white-space:normal; | |||
} | |||
.priceBox{ | |||
width: 90%; | |||
overflow: hidden; | |||
margin: 10rpx auto; | |||
} | |||
.f{ | |||
float: left; | |||
} | |||
.r{ | |||
float:right; | |||
} | |||
.sellingBox{ | |||
overflow: hidden | |||
} | |||
.fuhao{ | |||
color: #DF2D2D; | |||
font-size: 24rpx; | |||
float: left; | |||
font-family: OPPOSans; | |||
/* font-weight: bold; */ | |||
margin-top: 10rpx | |||
} | |||
.fuhaoX{ | |||
color: #d5af67; | |||
font-family: "PingFangSC-Medium"; | |||
font-size: 34rpx; | |||
font-weight: 400; | |||
float: left; | |||
margin-top: 5rpx | |||
} | |||
.btn{ | |||
width: 136rpx; | |||
height: 52rpx; | |||
border-radius: 26rpx; | |||
line-height: 52rpx; | |||
background: linear-gradient(90deg, #E3BA79, #BC8D3E); | |||
text-align: center; | |||
color: #feffff; | |||
font-family: "PingFangSC-Regular"; | |||
font-size: 28rpx; | |||
font-weight: 400; | |||
} | |||
.int{ | |||
float: left; | |||
font-size: 36rpx; | |||
font-family: OPPOSans; | |||
font-weight: bold; | |||
color: #DF2D2D; | |||
} | |||
.originalBox{ | |||
overflow: hidden | |||
} | |||
.origina{ | |||
text-align: right; | |||
font-size: 24rpx; | |||
font-family: OPPOSans; | |||
font-weight: 400; | |||
text-decoration: line-through; | |||
color: #999999; | |||
margin-top: 10rpx; | |||
margin-right: 10rpx; | |||
} | |||
.priceNum{ | |||
text-align: right; | |||
font-size: 24rpx; | |||
font-family: OPPOSans; | |||
font-weight: 400; | |||
color: #999999; | |||
margin-top: 10rpx; | |||
/* margin-right: 10rpx; */ | |||
} | |||
.sellout{ | |||
position: absolute; | |||
top: 0; | |||
left: 0; | |||
background-color: rgba(0, 0, 0, 0.5); | |||
width: 100%; | |||
height: 100%; | |||
border-radius: 20rpx; | |||
} | |||
.selloutImg{ | |||
width: 195rpx !important; | |||
height: 154rpx !important; | |||
margin: 50% auto; | |||
display: block | |||
} |
@@ -0,0 +1,114 @@ | |||
const imgurl = require("../../utils/imgurl"); | |||
Component({ | |||
/** | |||
* 组件的属性列表 | |||
*/ | |||
properties: { | |||
merchantVoList: { | |||
value: [], | |||
type: Array | |||
} | |||
}, | |||
/** | |||
* 组件的初始数据 | |||
*/ | |||
data: { | |||
teljpgUrl: imgurl.teljpg.url, | |||
showMore:false, | |||
more: "点击查看更多", | |||
hidden:"hidden", | |||
height: "" | |||
}, | |||
/** | |||
* 组件的方法列表 | |||
*/ | |||
methods: { | |||
/** | |||
* 跳转到门店列表的详情页面 | |||
*/ | |||
gotoDetail(e) { | |||
tt.navigateTo({ | |||
url: `/pages/index/searchbar/detail/index?id=${e.currentTarget.dataset.id}` | |||
}) | |||
}, | |||
goCertification(e){ | |||
tt.navigateTo({ | |||
url: `/pages/shopCertification/shopCertification?id=${e.currentTarget.dataset.id}` | |||
}) | |||
}, | |||
goFitShop(){ | |||
tt.navigateTo({ | |||
url: `/pages/fitShop/fitShop?list=${JSON.stringify(this.data.merchantVoList)}`, | |||
success: (res) => { | |||
}, | |||
fail: (res) => { | |||
}, | |||
}); | |||
}, | |||
goMap(e){ | |||
let {latitude,longitude} = e.currentTarget.dataset.item | |||
console.log(latitude,longitude); | |||
tt.openLocation({ | |||
latitude:Number(latitude), | |||
longitude:Number(longitude), | |||
scale: 18, | |||
success() { | |||
console.log("打开地图成功"); | |||
}, | |||
fail(err) { | |||
console.log("打开地图失败:", err.errMsg); | |||
}, | |||
}); | |||
}, | |||
// 点击查看更多 | |||
more: function () { | |||
console.log(this.properties.merchantVoList,"merchantVoList"); | |||
let that = this; | |||
if (that.data.more == '点击查看更多') { | |||
this.setData({ | |||
hidden: "", | |||
height: 'auto!important', | |||
more: "点击收起", | |||
showMore: true | |||
}) | |||
} else { | |||
that.setData({ | |||
hidden: "hidden", | |||
height: 4 * 140 + 'rpx', | |||
more: "点击查看更多", | |||
showMore: true | |||
}) | |||
} | |||
}, | |||
phone: function (e) { | |||
let that = this; | |||
tt.makePhoneCall({ | |||
phoneNumber: e.target.dataset.merchantlinkphone | |||
}); | |||
}, | |||
}, | |||
ready: function () { | |||
let merchantVoList = this.properties.merchantVoList; | |||
if (merchantVoList.length>0){ | |||
if (merchantVoList.length <= 4) { | |||
this.setData({ | |||
height: merchantVoList.length * 140 + 'rpx', | |||
showMore: false, | |||
hidden:"hidden" | |||
}) | |||
} else if (merchantVoList && merchantVoList.length > 4) { | |||
this.setData({ | |||
height: 4 * 140 + 'rpx' | |||
}) | |||
} | |||
} | |||
} | |||
}); |
@@ -0,0 +1,3 @@ | |||
{ | |||
"component": true | |||
} |
@@ -0,0 +1,68 @@ | |||
<view class="applyshopBox" bindtap="goFitShop"> | |||
<view class='applyshop'>适用门店</view> | |||
<image src="https://formall.oss-accelerate.aliyuncs.com/cimg/chevron.png" mode="widthFix" class="genduoImg"> | |||
</image> | |||
<view class="goShop">{{merchantVoList.length+'家店适用'}}</view> | |||
</view> | |||
<!-- style='overflow:{{hidden}};height:{{height}}' --> | |||
<view class='posi'> | |||
<view class='posi_logo'> | |||
<view bindtap='gotoDetail' data-id='{{merchantVoList[0].id}}'> | |||
<image src='{{merchantVoList[0].merchantImgUrl}}'></image> | |||
</view> | |||
<view bindtap='gotoDetail' data-id='{{merchantVoList[0].id}}'> | |||
<view class='name'>{{merchantVoList[0].merchantName}}</view> | |||
<view class='shopVoList'> | |||
<view tt:for="{{merchantVoList[0].shopVoList}}" tt:key="{{index}}" tt:for-item="itemName" class="shopCh"> | |||
<text>{{itemName.buildingName}}{{itemName.floorName}}--{{itemName.shopNumber}}</text> | |||
<text class='douhao' tt:if="{{item.shopVoList.length>1}}">,</text> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="telBox" tt:if="{{merchantVoList[0].linkLinePhone}}"> | |||
<image bindtap='phone' data-merchantLinkPhone='{{merchantVoList[0].linkLinePhone}}' class="telImg" src="{{teljpgUrl}}" mode="widthFix" /> | |||
<view class="telText">电话</view> | |||
</view> | |||
<view class="certificationBox" tt:if="{{merchantVoList[0].latitude&&merchantVoList[0].longitude}}" bindtap="goCertification" data-id="{{merchantVoList[0].id}}"> | |||
<image class="certificationImg" src="../../assets/imgData/certification.png" mode="widthFix" /> | |||
<view class="telText">资质</view> | |||
</view> | |||
</view> | |||
<view class="siteBox" tt:if="{{merchantVoList[0].latitude&&merchantVoList[0].longitude}}" bindtap="goMap" data-item="{{merchantVoList[0]}}"> | |||
<view class="siteText">{{merchantVoList[0].addr}}</view> | |||
<image class="siteImg" src="../../assets/imgData/siteImg.png" mode="widthFix" /> | |||
</view> | |||
</view> | |||
<!-- <view class='posi' tt:for="{{merchantVoList}}" tt:key="index"> | |||
<view class='posi_logo'> | |||
<view bindtap='gotoDetail' data-id='{{item.id}}'> | |||
<image src='{{item.merchantImgUrl}}'></image> | |||
</view> | |||
<view bindtap='gotoDetail' data-id='{{item.id}}'> | |||
<view class='name'>{{item.merchantName}}</view> | |||
<view class='shopVoList'> | |||
<view tt:for="{{item.shopVoList}}" tt:key="{{index}}" tt:for-item="itemName"> | |||
<text>{{itemName.buildingName}}{{itemName.floorName}}--{{itemName.shopNumber}}</text> | |||
<text class='douhao' tt:if="{{item.shopVoList.length>1}}">,</text> | |||
</view> | |||
</view> | |||
</view> | |||
<view class="telBox" tt:if="{{item.linkLinePhone}}"> | |||
<image bindtap='phone' data-merchantLinkPhone='{{item.linkLinePhone}}' class="telImg" src="{{teljpgUrl}}" mode="widthFix" /> | |||
<view class="telText">电话</view> | |||
</view> | |||
<view class="certificationBox" tt:if="{{item.latitude&&item.longitude}}" bindtap="goCertification" data-id="{{item.id}}"> | |||
<image class="certificationImg" src="../../assets/imgData/certification.png" mode="widthFix" /> | |||
<view class="telText">资质</view> | |||
</view> | |||
</view> | |||
<view class="siteBox" tt:if="{{item.latitude&&item.longitude}}" bindtap="goMap" data-item="{{item}}"> | |||
<view class="siteText">{{item.addr}}</view> | |||
<image class="siteImg" src="../../assets/imgData/siteImg.png" mode="widthFix" /> | |||
</view> | |||
</view> --> | |||
<view class='bottom' bindtap='more' tt:if="{{showMore}}">{{more}}</view> |
@@ -0,0 +1,152 @@ | |||
.applyshop { | |||
font-size: 30rpx; | |||
height: 70rpx; | |||
line-height: 70rpx; | |||
text-indent: 1em; | |||
color: #333; | |||
background: #fff; | |||
font-weight: bold; | |||
float: left; | |||
} | |||
.applyshopBox{ | |||
overflow: hidden; | |||
background: #fff; | |||
margin-top: 20rpx; | |||
} | |||
.goShop{ | |||
font-size: 22rpx; | |||
height: 70rpx; | |||
line-height: 70rpx; | |||
text-indent: 1em; | |||
color: #a6a6a6; | |||
background: #fff; | |||
font-weight: bold; | |||
float: right; | |||
/* margin-right: 20rpx; */ | |||
} | |||
.posi { | |||
/* position: relative; */ | |||
width: 100%; | |||
background: #FFF; | |||
margin-bottom: 20rpx; | |||
} | |||
.posi_logo { | |||
position: relative; | |||
width: 92%; | |||
display: flex; | |||
padding: 20rpx 0; | |||
background: #fff; | |||
margin: 0 auto; | |||
} | |||
/* .posi_logo view:nth-child(1) { | |||
border-radius: 16rpx; | |||
} */ | |||
.shopCh{ | |||
border-radius: 16rpx; | |||
} | |||
.posi_logo view:nth-child(1) image { | |||
display: block; | |||
width: 100rpx; | |||
height: 100rpx; | |||
border-radius: 16rpx; | |||
margin-right: 16rpx; | |||
border: 1px solid #e5e5e5; | |||
} | |||
.name{ | |||
font-size: 32rpx; | |||
color: #333; | |||
letter-spacing: 0; | |||
width: 500rpx; | |||
white-space: nowrap; | |||
text-overflow: ellipsis; | |||
overflow: hidden; | |||
} | |||
/* .posi_logo view:nth-child(2) view { | |||
font-size: 32rpx; | |||
color: #333; | |||
letter-spacing: 0; | |||
} */ | |||
.shopVoList { | |||
white-space: nowrap !important; | |||
overflow-y: scroll; | |||
height: 90rpx !important; | |||
width: 360rpx; | |||
font-size: 16px; | |||
color: #333; | |||
letter-spacing: 0; | |||
} | |||
.shopVoList text { | |||
font-size: 20rpx !important; | |||
color: #b8b8b8 !important; | |||
} | |||
.bottom{ | |||
background: #fff; | |||
color: #666; | |||
text-align: center; | |||
padding: 20rpx 0; | |||
font-size: 32rpx; | |||
} | |||
.telBox { | |||
position: absolute; | |||
right: 0; | |||
top: 0; | |||
bottom: 0; | |||
margin: auto; | |||
} | |||
.telText{ | |||
text-align: center; | |||
color: #b8b8b8 !important; | |||
font-size: 20rpx; | |||
} | |||
.telImg{ | |||
width: 50rpx; | |||
height: 50rpx; | |||
margin-top: 20rpx; | |||
} | |||
.certificationBox{ | |||
position: absolute; | |||
right: 80rpx; | |||
top: 0; | |||
bottom: 0; | |||
margin: auto; | |||
} | |||
.certificationImg{ | |||
width: 50rpx; | |||
height: 50rpx; | |||
margin-top: 20rpx; | |||
} | |||
.siteBox{ | |||
overflow: hidden; | |||
width: 92%; | |||
margin: 0 auto 1rpx auto; | |||
padding-bottom: 10rpx; | |||
} | |||
.siteText{ | |||
width: 90%; | |||
float: left; | |||
font-size: 24rpx; | |||
color: #333; | |||
overflow: hidden; | |||
white-space: nowrap; | |||
text-overflow: ellipsis; | |||
} | |||
.siteImg{ | |||
float: right; | |||
width: 40rpx; | |||
height: 40rpx; | |||
} | |||
.genduoImg{ | |||
width: 14rpx; | |||
display: block; | |||
float: right; | |||
margin: 24rpx 30rpx 0 10rpx; | |||
} |
@@ -0,0 +1,168 @@ | |||
const Http = require("../../utils/HttpBasics"); | |||
var config = require("../../config/config.js"); | |||
let app = getApp(); | |||
Component({ | |||
data: { | |||
selected: null, | |||
"color": "#abb1be", | |||
"selectedColor": "#6c5535", | |||
list: [ | |||
{ | |||
"pagePath": "/index/index", | |||
"text": "首页", | |||
"iconPath": "../../assets/images/home.png", | |||
"selectedIconPath": "../../assets/images/home_a.png" | |||
}, | |||
{ | |||
"pagePath": "/index/searchbar", | |||
"text": "门店", | |||
"iconPath": "../../assets/images/portal.png", | |||
"selectedIconPath": "../../assets/images/portal_a.png" | |||
}, | |||
{ | |||
"pagePath": "/pages/order/index/index", | |||
"text": "订单", | |||
"iconPath": "../../assets/images/dindan.png", | |||
"selectedIconPath": "../../assets/images/dindan_a.png" | |||
}, | |||
{ | |||
"pagePath": "/index/user", | |||
"text": "我的", | |||
"iconPath": "../../assets/images/user.png", | |||
"selectedIconPath": "../../assets/images/user_a.png" | |||
} | |||
], | |||
}, | |||
properties: { | |||
}, | |||
lifetimes: { | |||
attached: function () { | |||
// 在组件实例进入页面节点树时执行 | |||
console.log(app.globalData.selected, 'selected'); | |||
this.setData({ | |||
selected: app.globalData.selected, | |||
// templateId:app.globalData.templateId | |||
}) | |||
}, | |||
detached: function () { | |||
// 在组件实例被从页面节点树移除时执行 | |||
}, | |||
}, | |||
methods: { | |||
navigateTo(e) { | |||
// this.setData({ | |||
// list: this.data.home_a_img | |||
// }) | |||
// console.log(this.data.home_a_img) | |||
const data = e.currentTarget.dataset; | |||
if(app.globalData.selected==data.index){ | |||
return | |||
} | |||
// tt.hideLoading(); | |||
tt.showLoading({ | |||
title: "加载中" | |||
}); | |||
app.globalData.selected = data.index | |||
console.log(app.globalData.selected); | |||
const url = data.path; | |||
if (data.index == 0 || data.index == 3) { | |||
this.setWxMessage() | |||
} | |||
if(data.index == 2){ | |||
app.globalData.ifshowtab=true | |||
}else{ | |||
app.globalData.ifshowtab=false | |||
} | |||
// tt.reLaunch({ | |||
// url | |||
// }); | |||
tt.reLaunch({ | |||
url: url, | |||
success: (res) => { | |||
tt.hideLoading(); | |||
}, | |||
fail: (res) => { | |||
tt.hideLoading(); | |||
}, | |||
}); | |||
}, | |||
// getTemplateId() { | |||
// // console.log("隐藏") | |||
// // tt.hideTabBar() | |||
// Http.get({ | |||
// url: config.api.templateId, | |||
// data: { | |||
// pageNum: 1, | |||
// pageSize: 100 | |||
// } | |||
// }).then(res => { | |||
// const { | |||
// code, | |||
// data | |||
// } = res | |||
// if (code == 200) { | |||
// this.setData({ | |||
// templateId: data.list | |||
// }) | |||
// this.setWxMessage() | |||
// } else { | |||
// return | |||
// } | |||
// }) | |||
// }, | |||
setWxMessage() { | |||
if(app.globalData.templateId.length<0)return | |||
console.log(app.globalData.templateId); | |||
let tmplIds = [] | |||
app.globalData.templateId.map(res => { | |||
tmplIds.push(res.templateId) | |||
}) | |||
tt.requestSubscribeMessage({ | |||
tmplIds: tmplIds, | |||
success(res) { | |||
console.log("我重复订阅") | |||
let _statue = null | |||
tmplIds.map((item, index) => { //判读用户是否点击了确定 | |||
if (res[item] == "accept") { | |||
_statue = 'ok' | |||
} | |||
}) | |||
if (_statue == 'ok') { | |||
Http.post({ | |||
url: config.api.wxMsg | |||
}).then(res => { | |||
tt.setStorageSync({ | |||
key: 'ifShowTab', | |||
data: true, | |||
}) | |||
console.log(res) | |||
}) | |||
return | |||
} | |||
}, | |||
fail(error) { | |||
//订阅失败 | |||
console.log("订阅失败, 错误详情: ", error); | |||
// tt.showToast({ | |||
// title: "订阅失败", | |||
// icon: "fail", | |||
// }); | |||
}, | |||
complete() { | |||
} | |||
}) | |||
}, | |||
} | |||
}) |