Commit 8c1e478e authored by xieyishang's avatar xieyishang

‘addxx

parent d0a51525
{ {
"pages": [ "pages": [
"pages/lmping/user/user",
"pages/lmping/home/home", "pages/lmping/home/home",
"pages/lmping/user/user",
"pages/lmping/hometwo/hometwo", "pages/lmping/hometwo/hometwo",
"pages/lmping/signin/signin", "pages/lmping/signin/signin",
"pages/lmping/order/order", "pages/lmping/order/order",
"pages/lmping/myfans/myfans", "pages/lmping/myfans/myfans",
"pages/lmping/pushcard/pushcard", "pages/lmping/pushcard/pushcard",
"pages/lmping/lmvallog/lmvallog", "pages/lmping/lmvallog/lmvallog",
"pages/lmping/profitlog/profitlog", "pages/lmping/profitlog/profitlog",
"pages/lmping/rechargelog/rechargelog", "pages/lmping/rechargelog/rechargelog",
"pages/lmping/activitydescri/activitydescri", "pages/lmping/activitydescri/activitydescri",
"pages/address_list/address_list",
"pages/pay/pay", "pages/pay/pay",
"pages/webview/webview" "pages/webview/webview",
"pages/order/order",
"pages/new_address/new_address"
], ],
"subpackages": [ "subpackages": [
{ {
"root": "pages/shop/", "root": "pages/shop/",
"pages": [ "pages": [
"shops/weidian/ping_details/ping_details" "shops/weidian/ping_details/ping_details"
] ]
} }
], ],
...@@ -36,7 +36,6 @@ ...@@ -36,7 +36,6 @@
"borderStyle": "white", "borderStyle": "white",
"backgroundColor": "#fafafa", "backgroundColor": "#fafafa",
"list": [ "list": [
{ {
"pagePath": "pages/lmping/home/home", "pagePath": "pages/lmping/home/home",
"text": "拼团", "text": "拼团",
......
// compont/rili.js
var bianLIyear;
var bianLImonth;
var bianLIday;
var riLi = []
var shangY = []
var xiaY = []
var xianxuNZ = [];
var xuanZheData = [];
var windowHeight;
var util = require('./longli.js');
var objfunction;
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
date: ['', '', '', '', '', '', ''],
year: null,//遍历的年
month: null,//遍历的月
day: null,
xianShi: null,//今天的年月
xianDay: null,//几天的日期
xianShiZongData: [],//今后7个月遍历的日期
jiaShu: 1,
animationData: ''
},
/**
* 组件的方法列表
*/
ready:function(){
this.yunXian();
wx.getSystemInfo({
success: function (res) {
windowHeight = res.windowHeight
}
})
},
methods: {
//运行,循环获取加上本月与未来6个月,共七个月的数据
yunXian: function () {
var myDate = new Date();
var year = myDate.getFullYear()
var month = myDate.getMonth() + 1
var day = myDate.getDate()
var jiaYue = month + 6;//要循环的月份
var shangBu;
var xiabu;
if (jiaYue > 12) {
shangBu = 12
xiabu = jiaYue - 12
}
else {
//console.log(jiaYue)
}
if (jiaYue > 12) {
for (let l = year; l <= parseInt(year) + 1; l++) {
if (jiaYue > 12) {
if (l == year) {
for (let ll = month; ll <= shangBu; ll++) {
bianLIyear = l;
bianLImonth = ll;
bianLIday = day
this.kaiSHiyun();
}
}
else {
for (let ll = 1; ll <= xiabu; ll++) {
bianLIyear = l;
bianLImonth = ll;
bianLIday = day
this.kaiSHiyun();
}
}
}
}
}
else {
for (let l = year; l <= parseInt(year); l++) {
for (let ll = month; ll <= jiaYue; ll++) {
bianLIyear = l;
bianLImonth = ll;
bianLIday = day
this.kaiSHiyun();
}
}
}
if (month.toString().length < 2) {
month = '0' + month
}
else {
month = month
}
this.setData({
xianShiZongData: xianxuNZ,
xianShi: year + '-' + month,
xianDay: day,
})
},
//计算每个月的数据
kaiSHiyun: function () {
riLi = []
shangY = []
xiaY = []
var dayNum = new Date(bianLIyear, bianLImonth, 0).getDate();
var dayNumS = new Date(bianLIyear, parseInt(bianLImonth) - 1, 0).getDate();
var dayNumX = new Date(bianLIyear, parseInt(bianLImonth) + 1, 0).getDate();
var startWeek = new Date('' + bianLIyear + ',' + bianLImonth + ',1').getDay();
for (var ij = startWeek - 1; ij >= 0; ij--) {
shangY.push(parseInt(dayNumS) - parseInt(ij))
}
for (var ii = 1; ii <= dayNum; ii++) {
var riqi = {};
riqi.data = ii;
riqi.Num = startWeek + (ii - 1) % 7
riqi.getTime = new Date(bianLIyear + '/' + bianLImonth + '/' + ii).getTime();
riLi.push(riqi)
}
var shu = riLi.length + shangY.length;
if (shu % 7 > 0) {
for (var ijj = 1; ijj <= 7 - shu % 7; ijj++) {
xiaY.push(ijj)
}
}
var panXZhong = {};
var jiaBianLiyue
if (bianLImonth.toString().length < 2) {
jiaBianLiyue = '0' + bianLImonth
}
else {
jiaBianLiyue = bianLImonth
}
panXZhong.xian = bianLIyear + '-' + jiaBianLiyue
panXZhong.xainData = riLi
panXZhong.shangData = shangY
panXZhong.xiaData = xiaY
xianxuNZ.push(panXZhong)
},
//点击选择时间
dianXuan: function (e) {
var shiJIan = e.currentTarget.dataset.shi + '-' + e.currentTarget.dataset.day
var xuanriArr = shiJIan.split("-");
var shiJIanHaoMiao = new Date(shiJIan.replace(new RegExp("-", "gm"), "/")).getTime()
var chang = windowHeight;
var that = this;
var cunIndex = -1;
var animation = wx.createAnimation({
transformOrigin: "50% 50%",
duration: 1000,
timingFunction: "ease",
delay: 0
})
animation.translateY(chang).step()
if (xuanriArr[1].length < 2) {
var xuanYue = '0' + xuanriArr[1]
}
else {
var xuanYue = xuanriArr[1]
}
if (xuanriArr[2].length < 2) {
var xuanRi = '0' + xuanriArr[2]
}
else {
var xuanRi = xuanriArr[2]
}
for (let d = 0; d < xuanZheData.length; d++) {
if (shiJIanHaoMiao == xuanZheData[d].getTime) {
cunIndex = d
}
}
if (cunIndex != -1) {
xuanZheData.splice(cunIndex, 1)
}
else {
if (xuanZheData.length < 2) {
if (xuanZheData.length >= 1) {
var firstZHI = xuanZheData[0].xuanShiJian + '-' + xuanZheData[0].xuanDayShi
firstZHI = firstZHI.replace(new RegExp("-", "gm"), "/")
var twoZHI = e.currentTarget.dataset.shi + '-' + e.currentTarget.dataset.day
twoZHI = twoZHI.replace(new RegExp("-", "gm"), "/")
//console.log('firstZHI', firstZHI)
//console.log('twoZHI', twoZHI)
if (new Date(twoZHI).getTime() < new Date(firstZHI).getTime()) {
var cha = new Date(firstZHI).getTime() - new Date(twoZHI).getTime()
xuanZheData.splice(0, 0, { xuanShiJian: e.currentTarget.dataset.shi, xuanDayShi: e.currentTarget.dataset.day, getTime: shiJIanHaoMiao })
xuanZheData[1].chaDay = parseInt(cha / 86400000)
delete xuanZheData[0].chaDay;
}
else {
var cha = new Date(twoZHI).getTime() - new Date(firstZHI).getTime()
xuanZheData.push({ xuanShiJian: e.currentTarget.dataset.shi, xuanDayShi: e.currentTarget.dataset.day, getTime: shiJIanHaoMiao, chaDay: parseInt(cha / 86400000) })
delete xuanZheData[0].chaDay;
}
}
else {
xuanZheData.push({ xuanShiJian: e.currentTarget.dataset.shi, xuanDayShi: e.currentTarget.dataset.day, getTime: shiJIanHaoMiao })
}
}
else {
var firstZHI = xuanZheData[0].xuanShiJian + '-' + xuanZheData[0].xuanDayShi
firstZHI = firstZHI.replace(new RegExp("-", "gm"), "/")
var twoZHI = e.currentTarget.dataset.shi + '-' + e.currentTarget.dataset.day
twoZHI = twoZHI.replace(new RegExp("-", "gm"), "/")
if (new Date(twoZHI).getTime() < new Date(firstZHI).getTime()) {
var cha = new Date(firstZHI).getTime() - new Date(twoZHI).getTime()
xuanZheData.splice(0, 0, { xuanShiJian: e.currentTarget.dataset.shi, xuanDayShi: e.currentTarget.dataset.day, getTime: shiJIanHaoMiao })
xuanZheData[1].chaDay = parseInt(cha / 86400000)
delete xuanZheData[0].chaDay;
xuanZheData.splice(2, 1)
}
else {
var cha = new Date(twoZHI).getTime() - new Date(firstZHI).getTime()
xuanZheData.splice(1, 1, { xuanShiJian: e.currentTarget.dataset.shi, xuanDayShi: e.currentTarget.dataset.day, getTime: shiJIanHaoMiao, chaDay: parseInt(cha / 86400000) })
delete xuanZheData[0].chaDay;
}
}
}
var thatBIanHUan
if (xuanZheData.length >= 2) {
thatBIanHUan = animation.export()
}
else {
thatBIanHUan = null
}
if (xuanZheData.length == 2) {
xuanZheData[0].text = '入住'; xuanZheData[1].text = '离开'
}
else {
//console.log(xuanZheData[0])
if (xuanZheData[0]) {
delete xuanZheData[0].text;
}
if (xuanZheData[1]) {
delete xuanZheData[1].text;
}
}
// console.log(xuanZheData)
that.setData({
animationData: thatBIanHUan,
xuanShiJian: e.currentTarget.dataset.shi,
xuanDayShi: e.currentTarget.dataset.day,
xuanri: xuanYue + '-' + xuanRi,
xuanZheData: xuanZheData
})
var xsw_Data=[]
for (let r = 0; r < xuanZheData.length;r++){
var obj={}
var xsw_day = xuanZheData[r].xuanDayShi.toString()
if (xsw_day.length<2){
xsw_day = '0' + xsw_day
}
obj.data = xuanZheData[r].xuanShiJian + '-' + xsw_day
obj.getTime = xuanZheData[r].getTime
if (xuanZheData[r].chaDay){
obj.chaDay = ''+ xuanZheData[r].chaDay+''
}
obj.text = xuanZheData[r].text
xsw_Data.push(obj)
}
return objfunction(xsw_Data)
},
quXiao: function () {
var chang = windowHeight;
var that = this;
var animation = wx.createAnimation({
transformOrigin: "50% 50%",
duration: 1000,
timingFunction: "ease",
delay: 0
})
xuanZheData = []
animation.translateY(chang).step()
that.setData({
animationData: animation.export(),
tiao: 'tiao',
xuanShiJian: "",
xuanDayShi: "",
xuanri: "",
xuanZheData: xuanZheData
})
return objfunction(null)
},
quding: function () {
var chang = windowHeight;
var that = this;
var animation = wx.createAnimation({
transformOrigin: "50% 50%",
duration: 1000,
timingFunction: "ease",
delay: 0
})
if (xuanZheData.length == 1) {
wx.showModal({
title: '提示',
content: '第一次选择的是开始时间!',
showCancel: false,
success: function (res) {
}
})
}
animation.translateY(chang).step()
that.setData({
xuanZheData: xuanZheData,
animationData: animation.export(),
})
},
/****************其他事件************************* */
xianShi: function (obj) {
if (obj.data) {
objfunction = obj.data
}
var chang = windowHeight;
var that = this;
var animation = wx.createAnimation({
transformOrigin: "50% 50%",
duration: 500,
timingFunction: "ease",
delay: 0
})
animation.translateY(-chang).step()
that.setData({
animationData: animation.export()
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view animation="{{animationData}}" class="page" id="page">
<view class="scroll">
<view class="zhiDing1">
<view class="zhiMian">
<view class="quZI" bindtap='quXiao'>取消</view>
<view class="quZI1" bindtap='quding'>确定</view>
</view>
</view>
<view class="zhiDing">
<view class="list " wx:for="{{date}}" wx:key="index">{{item}}</view>
</view>
<scroll-view class="scroll1" scroll-y='true' scroll-into-view='{{tiao}}'>
<view id="tiao"></view>
<view class="xianRi" wx:for="{{xianShiZongData}}" wx:for-item='list' wx:key="index">
<view class="xianriLI_1">{{list.xian}}</view>
<view class='xianriLI'>
<view class="list quXia" wx:for="{{list.shangData}}" wx:key="index">{{item}}</view>
<view wx:if="{{xianShi==list.xian && item.data<xianDay}}" class="list hui" wx:for="{{list.xainData}}"
wx:key="index">{{item.data}}</view>
<view wx:if="{{xianShi==list.xian && item.data>=xianDay || xianShi!=list.xian}}"
class="list {{(item.getTime>xuanZheData[0].getTime && item.getTime<xuanZheData[1].getTime)?'bgDate':''}}"
wx:for="{{list.xainData}}" wx:key="index" bindtap='dianXuan' data-day='{{item.data}}'
data-shi='{{list.xian}}'>
<view wx:if='{{xuanZheData.length==2 && item.getTime==xuanZheData[0].getTime}}' class='qiangXuan'></view>
<view wx:if='{{xuanZheData.length==2 && item.getTime==xuanZheData[1].getTime}}' class='houXuan'></view>
<view
class="xianDayaRi {{xuanZheData.length==2 && (item.getTime==xuanZheData[0].getTime||item.getTime==xuanZheData[1].getTime)?'xuanbgDate':''}} {{xianShi==list.xian && xianDay==item.data?'day':''}} {{(xuanZheData[0].xuanShiJian==list.xian && xuanZheData[0].xuanDayShi==item.data)||(xuanZheData[1].xuanShiJian==list.xian && xuanZheData[1].xuanDayShi==item.data)?'xaunDay':''}}">
<view>{{item.data}}</view>
<view wx:if='{{xuanZheData.length==2 && item.getTime==xuanZheData[0].getTime}}' class='ruzhu'>
{{xuanZheData[0].text}}</view>
<view wx:if='{{xuanZheData.length==2 && item.getTime==xuanZheData[1].getTime}}' class='likai'>
{{xuanZheData[1].text}}</view>
</view>
</view>
<view class="list quXia" wx:for="{{list.xiaData}}" wx:key="index">{{item}}</view>
</view>
</view>
</scroll-view>
</view>
</view>
\ No newline at end of file
page{
/* height: 100%; */
position: relative;
}
/****************日历样式**********************/
.page{
height:100%;
position: fixed;
top: 100%;
background-color: #fff;
}
.scroll{
height: 100%;
position: relative;
}
.scroll1{
height: calc(100% - 160rpx);
padding-top: 160rpx;
}
.top{
display: flex;
flex-flow: row;
flex-wrap: nowrap;
justify-content: space-around;
align-items: center;
}
.dianxian{
width: 100%;
}
.xianRi{
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: flex-start;
align-items: center;
border-bottom:2rpx #ccc solid;
}
.zhiDing1{
position:absolute;
width: 100%;
height: 80rpx;
border-top:2rpx #ccc solid;
border-bottom:2rpx #ccc solid;
}
.zhiMian{
width: 92%;
margin: 0 auto;
height: 80rpx;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: space-between;
align-items: center;
}
.quZI{
font-size: 28rpx;
color:red;
}
.quZI1{
font-size: 28rpx;
color:#999;
}
.zhiDing{
position:absolute;
width: 100%;
height: 80rpx;
top: 80rpx;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
}
.zhiDing .list:first-child,.zhiDing .list:last-child{
color:red
}
.xianRi:first-child{
margin-top: 30rpx;
}
.xianriLI_1{
width: 100%;
padding:30rpx 0 10rpx 4%;
font-size: 28rpx;
font-weight: bold;
}
.xianriLI{
width: 100%;
display: flex;
flex-direction: row;
flex-wrap: wrap;
justify-content: center;
align-items: center;
}
.zhiDing .list,.xianRi .xianriLI .list{
display: flex;
justify-content: center;
align-items: center;
width:calc(100%/7);
height: 70rpx;
margin: 5px 0;
font-size: 24rpx;
}
.xianRi .xianriLI .list{
position: relative;
z-index: 9;
}
.day{
background-color: red;
color: #fff;
border-radius: 50rpx;
/* border: 2rpx red solid; */
}
.xaunDay{
background-color: #f64f15 !important;
color: #fff !important;
border-radius: 50rpx;
}
.quShang{
color:#ccc;
opacity: 0;
}
.quXia{
color:#ccc;
opacity: 0;
}
.xuanZ{
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: center;
align-items: center;
}
.zuoyou{
width: 120rpx;
text-align: center
}
.hui{
color: #ccc;
}
.xianDayaRi{
position: relative;
z-index: 9;
height: 70rpx;
width: 70rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.xuanbgDate{
background-color: #fff;
color:#000;
}
.bgDate{
background-color:rgba(255, 194, 150, .5);
}
.qiangXuan{
background-color: #f64f15;
position: absolute;
z-index: 1;
right: 0;
width: 60rpx;
height: 70rpx;
}
.houXuan{
background-color:#f64f15;
position: absolute;
z-index: 1;
left: 0;
width: 60rpx;
height: 70rpx;
}
.ruzhu{
font-size: 20rpx;
font-weight: bold;
color: #fff
}
.likai{
font-size: 20rpx;
font-weight: bold;
color: #fff;
}
.ziDaXIao{
font-size: 20rpx;
}
/********************************************/
.xianShi{
width: 100%;
display: flex;
justify-content: flex-start;
align-items: center;
}
.starTime,.endTime{
flex: 3;
display: flex;
justify-content: center;
align-items: center;
font-size: 28rpx;
}
.quJian{
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
font-size: 28rpx;
}
\ No newline at end of file
Component({
/**
* 组件的属性列表
*/
properties: {
propArray: {
type: Array,
}
},
/**
* 组件的初始数据
*/
data: {
selectShow: false,//初始option不显示
selectText: "请选择",//初始内容
},
/**
* 组件的方法列表
*/
methods: {
//option的显示与否
selectToggle: function () {
var nowShow = this.data.selectShow;//获取当前option显示的状态
this.setData({
selectShow: !nowShow
})
},
//设置内容
setText: function (e) {
var nowData = this.properties.propArray;//当前option的数据是引入组件的页面传过来的,所以这里获取数据只有通过this.properties
var nowIdx = e.target.dataset.index;//当前点击的索引
var nowText = nowData[nowIdx].text || nowData[nowIdx].value || nowData[nowIdx].Name || nowData[nowIdx];//当前点击的内容
//再次执行动画,注意这里一定,一定,一定是this.animation来使用动画
this.setData({
selectShow: false,
selectText: nowText,
})
this.triggerEvent('select', nowData[nowIdx])
},
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class='ms-content-box'>
<view class='ms-content' bindtap='selectToggle'>
<view class='ms-text'>{{selectText}}</view>
<view class="{{selectShow ? 'icon-up' : 'icon-down'}}"></view>
</view>
<view class='ms-options' wx:if="{{selectShow}}">
<view wx:for="{{propArray}}" data-index="{{index}}" wx:key='index' class='ms-option' bindtap='setText'>{{item.text || item.value || item.Name || item}}</view>
</view>
</view>
\ No newline at end of file
/* components/single-dropdown-select/index.wxss */
.ms-content-box {
width: 240rpx;
}
.ms-content {
border: 1px solid #e2e2e2;
background: white;
font-size: 12px;
position: relative;
height: 30px;
line-height: 30px;
}
.ms-text {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
padding: 0 40px 0 6px;
font-size: 12px;
}
.ms-options {
background: white;
width: inherit;
position: absolute;
border: 1px solid #e2e2e2;
border-top: none;
box-sizing: border-box;
z-index: 3;
max-height: 120px;
overflow: auto;
}
.ms-option {
height: 30px;
line-height: 30px;
border-top: 1px solid #e2e2e2;
padding: 0 6px;
text-align: left;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 12px;
}
.ms-item:first-child {
border-top: none;
}
.icon-right, .icon-down, .icon-up {
display: inline-block;
padding-right: 13rpx;
position: absolute;
right: 20rpx;
top: 10rpx;
}
.icon-right::after, .icon-down::after, .icon-up::after {
content: "";
display: inline-block;
position: relative;
bottom: 2rpx;
margin-left: 10rpx;
height: 10px;
width: 10px;
border: solid #bbb;
border-width: 2px 2px 0 0;
}
.icon-right::after {
-webkit-transform: rotate(45deg);
transform: rotate(45deg);
}
.icon-down::after {
bottom: 14rpx;
-webkit-transform: rotate(135deg);
transform: rotate(135deg);
}
.icon-up::after {
bottom: 0rpx;
-webkit-transform: rotate(-45deg);
transform: rotate(-45deg);
}
\ No newline at end of file
function chajie(y, m, d) {
/**
* @1900-2100区间内的公历、农历互转
* @charset UTF-8
* @Author Jea杨(JJonline@JJonline.Cn)
* @Time 2014-7-21
* @Time 2016-8-13 Fixed 2033hex、Attribution Annals
* @Time 2016-9-25 Fixed lunar LeapMonth Param Bug
* @Time 2017-7-24 Fixed use getTerm Func Param Error.use solar year,NOT lunar year
* @Version 1.0.3
* @公历转农历:calendar.solar2lunar(1987,11,01); //[you can ignore params of prefix 0]
* @农历转公历:calendar.lunar2solar(1987,09,10); //[you can ignore params of prefix 0]
*/
var calendar = {
/**
* 农历1900-2100的润大小信息表
* @Array Of Property
* @return Hex
*/
lunarInfo: [0x04bd8, 0x04ae0, 0x0a570, 0x054d5, 0x0d260, 0x0d950, 0x16554, 0x056a0, 0x09ad0, 0x055d2, //1900-1909
0x04ae0, 0x0a5b6, 0x0a4d0, 0x0d250, 0x1d255, 0x0b540, 0x0d6a0, 0x0ada2, 0x095b0, 0x14977, //1910-1919
0x04970, 0x0a4b0, 0x0b4b5, 0x06a50, 0x06d40, 0x1ab54, 0x02b60, 0x09570, 0x052f2, 0x04970, //1920-1929
0x06566, 0x0d4a0, 0x0ea50, 0x06e95, 0x05ad0, 0x02b60, 0x186e3, 0x092e0, 0x1c8d7, 0x0c950, //1930-1939
0x0d4a0, 0x1d8a6, 0x0b550, 0x056a0, 0x1a5b4, 0x025d0, 0x092d0, 0x0d2b2, 0x0a950, 0x0b557, //1940-1949
0x06ca0, 0x0b550, 0x15355, 0x04da0, 0x0a5b0, 0x14573, 0x052b0, 0x0a9a8, 0x0e950, 0x06aa0, //1950-1959
0x0aea6, 0x0ab50, 0x04b60, 0x0aae4, 0x0a570, 0x05260, 0x0f263, 0x0d950, 0x05b57, 0x056a0, //1960-1969
0x096d0, 0x04dd5, 0x04ad0, 0x0a4d0, 0x0d4d4, 0x0d250, 0x0d558, 0x0b540, 0x0b6a0, 0x195a6, //1970-1979
0x095b0, 0x049b0, 0x0a974, 0x0a4b0, 0x0b27a, 0x06a50, 0x06d40, 0x0af46, 0x0ab60, 0x09570, //1980-1989
0x04af5, 0x04970, 0x064b0, 0x074a3, 0x0ea50, 0x06b58, 0x055c0, 0x0ab60, 0x096d5, 0x092e0, //1990-1999
0x0c960, 0x0d954, 0x0d4a0, 0x0da50, 0x07552, 0x056a0, 0x0abb7, 0x025d0, 0x092d0, 0x0cab5, //2000-2009
0x0a950, 0x0b4a0, 0x0baa4, 0x0ad50, 0x055d9, 0x04ba0, 0x0a5b0, 0x15176, 0x052b0, 0x0a930, //2010-2019
0x07954, 0x06aa0, 0x0ad50, 0x05b52, 0x04b60, 0x0a6e6, 0x0a4e0, 0x0d260, 0x0ea65, 0x0d530, //2020-2029
0x05aa0, 0x076a3, 0x096d0, 0x04afb, 0x04ad0, 0x0a4d0, 0x1d0b6, 0x0d250, 0x0d520, 0x0dd45, //2030-2039
0x0b5a0, 0x056d0, 0x055b2, 0x049b0, 0x0a577, 0x0a4b0, 0x0aa50, 0x1b255, 0x06d20, 0x0ada0, //2040-2049
/**Add By JJonline@JJonline.Cn**/
0x14b63, 0x09370, 0x049f8, 0x04970, 0x064b0, 0x168a6, 0x0ea50, 0x06b20, 0x1a6c4, 0x0aae0, //2050-2059
0x0a2e0, 0x0d2e3, 0x0c960, 0x0d557, 0x0d4a0, 0x0da50, 0x05d55, 0x056a0, 0x0a6d0, 0x055d4, //2060-2069
0x052d0, 0x0a9b8, 0x0a950, 0x0b4a0, 0x0b6a6, 0x0ad50, 0x055a0, 0x0aba4, 0x0a5b0, 0x052b0, //2070-2079
0x0b273, 0x06930, 0x07337, 0x06aa0, 0x0ad50, 0x14b55, 0x04b60, 0x0a570, 0x054e4, 0x0d160, //2080-2089
0x0e968, 0x0d520, 0x0daa0, 0x16aa6, 0x056d0, 0x04ae0, 0x0a9d4, 0x0a2d0, 0x0d150, 0x0f252, //2090-2099
0x0d520
], //2100
/**
* 公历每个月份的天数普通表
* @Array Of Property
* @return Number
*/
solarMonth: [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31],
/**
* 天干地支之天干速查表
* @Array Of Property trans["甲","乙","丙","丁","戊","己","庚","辛","壬","癸"]
* @return Cn string
*/
Gan: ["\u7532", "\u4e59", "\u4e19", "\u4e01", "\u620a", "\u5df1", "\u5e9a", "\u8f9b", "\u58ec", "\u7678"],
/**
* 天干地支之地支速查表
* @Array Of Property
* @trans["子","丑","寅","卯","辰","巳","午","未","申","酉","戌","亥"]
* @return Cn string
*/
Zhi: ["\u5b50", "\u4e11", "\u5bc5", "\u536f", "\u8fb0", "\u5df3", "\u5348", "\u672a", "\u7533", "\u9149", "\u620c",
"\u4ea5"
],
/**
* 天干地支之地支速查表<=>生肖
* @Array Of Property
* @trans["鼠","牛","虎","兔","龙","蛇","马","羊","猴","鸡","狗","猪"]
* @return Cn string
*/
Animals: ["\u9f20", "\u725b", "\u864e", "\u5154", "\u9f99", "\u86c7", "\u9a6c", "\u7f8a", "\u7334", "\u9e21",
"\u72d7", "\u732a"
],
/**
* 24节气速查表
* @Array Of Property
* @trans["小寒","大寒","立春","雨水","惊蛰","春分","清明","谷雨","立夏","小满","芒种","夏至","小暑","大暑","立秋","处暑","白露","秋分","寒露","霜降","立冬","小雪","大雪","冬至"]
* @return Cn string
*/
solarTerm: ["\u5c0f\u5bd2", "\u5927\u5bd2", "\u7acb\u6625", "\u96e8\u6c34", "\u60ca\u86f0", "\u6625\u5206",
"\u6e05\u660e", "\u8c37\u96e8", "\u7acb\u590f", "\u5c0f\u6ee1", "\u8292\u79cd", "\u590f\u81f3", "\u5c0f\u6691",
"\u5927\u6691", "\u7acb\u79cb", "\u5904\u6691", "\u767d\u9732", "\u79cb\u5206", "\u5bd2\u9732", "\u971c\u964d",
"\u7acb\u51ac", "\u5c0f\u96ea", "\u5927\u96ea", "\u51ac\u81f3"
],
/**
* 1900-2100各年的24节气日期速查表
* @Array Of Property
* @return 0x string For splice
*/
sTermInfo: ['9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf97c3598082c95f8c965cc920f',
'97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
'97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f', 'b027097bd097c36b0b6fc9274c91aa',
'97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd0b06bdb0722c965ce1cfcc920f',
'b027097bd097c36b0b6fc9274c91aa', '9778397bd19801ec9210c965cc920e', '97b6b97bd19801ec95f8c965cc920f',
'97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2', '9778397bd197c36c9210c9274c91aa',
'97b6b97bd19801ec95f8c965cc920e', '97bd09801d98082c95f8e1cfcc920f', '97bd097bd097c36b0b6fc9210c8dc2',
'9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec95f8c965cc920e', '97bcf97c3598082c95f8e1cfcc920f',
'97bd097bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e',
'97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
'97b6b97bd19801ec9210c965cc920e', '97bcf97c3598082c95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722',
'9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f',
'97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
'97bcf97c359801ec95f8c965cc920f', '97bd097bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
'97b6b97bd19801ec9210c965cc920e', '97bcf97c359801ec95f8c965cc920f', '97bd097bd07f595b0b6fc920fb0722',
'9778397bd097c36b0b6fc9210c8dc2', '9778397bd19801ec9210c9274c920e', '97b6b97bd19801ec95f8c965cc920f',
'97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e',
'97b6b97bd19801ec95f8c965cc920f', '97bd07f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2',
'9778397bd097c36c9210c9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bd07f1487f595b0b0bc920fb0722',
'7f0e397bd097c36b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
'97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
'97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
'9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e', '97bcf7f1487f531b0b0bb0b6fb0722',
'7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b97bd19801ec9210c965cc920e',
'97bcf7f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
'97b6b97bd19801ec9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
'9778397bd097c36b0b6fc9210c91aa', '97b6b97bd197c36c9210c9274c920e', '97bcf7f0e47f531b0b0bb0b6fb0722',
'7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '9778397bd097c36c9210c9274c920e',
'97b6b7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c36b0b6fc9210c8dc2',
'9778397bd097c36b0b70c9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722',
'7f0e397bd097c35b0b6fc9210c8dc2', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721',
'7f0e27f1487f595b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
'97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
'9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
'7f0e397bd097c35b0b6fc920fb0722', '9778397bd097c36b0b6fc9274c91aa', '97b6b7f0e47f531b0723b0b6fb0721',
'7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9274c91aa',
'97b6b7f0e47f531b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
'9778397bd097c36b0b6fc9210c91aa', '97b6b7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
'7f0e397bd07f595b0b0bc920fb0722', '9778397bd097c36b0b6fc9210c8dc2', '977837f0e37f149b0723b0787b0721',
'7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f5307f595b0b0bc920fb0722', '7f0e397bd097c35b0b6fc9210c8dc2',
'977837f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e37f1487f595b0b0bb0b6fb0722',
'7f0e397bd097c35b0b6fc9210c8dc2', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
'7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722', '977837f0e37f14998082b0787b06bd',
'7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd097c35b0b6fc920fb0722',
'977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
'7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
'7f0e27f1487f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14998082b0787b06bd',
'7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0b0bb0b6fb0722', '7f0e397bd07f595b0b0bc920fb0722',
'977837f0e37f14998082b0723b06bd', '7f07e7f0e37f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
'7f0e397bd07f595b0b0bc920fb0722', '977837f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b0721',
'7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f595b0b0bb0b6fb0722', '7f0e37f0e37f14898082b0723b02d5',
'7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e37f1487f531b0b0bb0b6fb0722',
'7f0e37f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
'7f0e37f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd',
'7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e37f14898082b072297c35',
'7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722',
'7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f149b0723b0787b0721',
'7f0e27f1487f531b0b0bb0b6fb0722', '7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14998082b0723b06bd',
'7f07e7f0e47f149b0723b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722', '7f0e37f0e366aa89801eb072297c35',
'7ec967f0e37f14998082b0723b06bd', '7f07e7f0e37f14998083b0787b0721', '7f0e27f0e47f531b0723b0b6fb0722',
'7f0e37f0e366aa89801eb072297c35', '7ec967f0e37f14898082b0723b02d5', '7f07e7f0e37f14998082b0787b0721',
'7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66aa89801e9808297c35', '665f67f0e37f14898082b0723b02d5',
'7ec967f0e37f14998082b0787b0721', '7f07e7f0e47f531b0723b0b6fb0722', '7f0e36665b66a449801e9808297c35',
'665f67f0e37f14898082b0723b02d5', '7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721',
'7f0e36665b66a449801e9808297c35', '665f67f0e37f14898082b072297c35', '7ec967f0e37f14998082b0787b06bd',
'7f07e7f0e47f531b0723b0b6fb0721', '7f0e26665b66a449801e9808297c35', '665f67f0e37f1489801eb072297c35',
'7ec967f0e37f14998082b0787b06bd', '7f07e7f0e47f531b0723b0b6fb0721', '7f0e27f1487f531b0b0bb0b6fb0722'
],
/**
* 数字转中文速查表
* @Array Of Property
* @trans ['日','一','二','三','四','五','六','七','八','九','十']
* @return Cn string
*/
nStr1: ["\u65e5", "\u4e00", "\u4e8c", "\u4e09", "\u56db", "\u4e94", "\u516d", "\u4e03", "\u516b", "\u4e5d",
"\u5341"
],
/**
* 日期转农历称呼速查表
* @Array Of Property
* @trans ['初','十','廿','卅']
* @return Cn string
*/
nStr2: ["\u521d", "\u5341", "\u5eff", "\u5345"],
/**
* 月份转农历称呼速查表
* @Array Of Property
* @trans ['正','一','二','三','四','五','六','七','八','九','十','冬','腊']
* @return Cn string
*/
nStr3: ["\u6b63", "\u4e8c", "\u4e09", "\u56db", "\u4e94", "\u516d", "\u4e03", "\u516b", "\u4e5d", "\u5341",
"\u51ac", "\u814a"
],
/**
* 返回农历y年一整年的总天数
* @param lunar Year
* @return Number
* @eg:var count = calendar.lYearDays(1987) ;//count=387
*/
lYearDays: function (y) {
var i, sum = 348;
for (i = 0x8000; i > 0x8; i >>= 1) {
sum += (calendar.lunarInfo[y - 1900] & i) ? 1 : 0;
}
return (sum + calendar.leapDays(y));
},
/**
* 返回农历y年闰月是哪个月;若y年没有闰月 则返回0
* @param lunar Year
* @return Number (0-12)
* @eg:var leapMonth = calendar.leapMonth(1987) ;//leapMonth=6
*/
leapMonth: function (y) { //闰字编码 \u95f0
return (calendar.lunarInfo[y - 1900] & 0xf);
},
/**
* 返回农历y年闰月的天数 若该年没有闰月则返回0
* @param lunar Year
* @return Number (0、29、30)
* @eg:var leapMonthDay = calendar.leapDays(1987) ;//leapMonthDay=29
*/
leapDays: function (y) {
if (calendar.leapMonth(y)) {
return ((calendar.lunarInfo[y - 1900] & 0x10000) ? 30 : 29);
}
return (0);
},
/**
* 返回农历y年m月(非闰月)的总天数,计算m为闰月时的天数请使用leapDays方法
* @param lunar Year
* @return Number (-1、29、30)
* @eg:var MonthDay = calendar.monthDays(1987,9) ;//MonthDay=29
*/
monthDays: function (y, m) {
if (m > 12 || m < 1) {
return -1
} //月份参数从1至12,参数错误返回-1
return ((calendar.lunarInfo[y - 1900] & (0x10000 >> m)) ? 30 : 29);
},
/**
* 返回公历(!)y年m月的天数
* @param solar Year
* @return Number (-1、28、29、30、31)
* @eg:var solarMonthDay = calendar.leapDays(1987) ;//solarMonthDay=30
*/
solarDays: function (y, m) {
if (m > 12 || m < 1) {
return -1
} //若参数错误 返回-1
var ms = m - 1;
if (ms == 1) { //2月份的闰平规律测算后确认返回28或29
return (((y % 4 == 0) && (y % 100 != 0) || (y % 400 == 0)) ? 29 : 28);
} else {
return (calendar.solarMonth[ms]);
}
},
/**
* 农历年份转换为干支纪年
* @param lYear 农历年的年份数
* @return Cn string
*/
toGanZhiYear: function (lYear) {
var ganKey = (lYear - 3) % 10;
var zhiKey = (lYear - 3) % 12;
if (ganKey == 0) ganKey = 10; //如果余数为0则为最后一个天干
if (zhiKey == 0) zhiKey = 12; //如果余数为0则为最后一个地支
return calendar.Gan[ganKey - 1] + calendar.Zhi[zhiKey - 1];
},
/**
* 公历月、日判断所属星座
* @param cMonth [description]
* @param cDay [description]
* @return Cn string
*/
toAstro: function (cMonth, cDay) {
var s =
"\u9b54\u7faf\u6c34\u74f6\u53cc\u9c7c\u767d\u7f8a\u91d1\u725b\u53cc\u5b50\u5de8\u87f9\u72ee\u5b50\u5904\u5973\u5929\u79e4\u5929\u874e\u5c04\u624b\u9b54\u7faf";
var arr = [20, 19, 21, 21, 21, 22, 23, 23, 23, 23, 22, 22];
return s.substr(cMonth * 2 - (cDay < arr[cMonth - 1] ? 2 : 0), 2) + "\u5ea7"; //座
},
/**
* 传入offset偏移量返回干支
* @param offset 相对甲子的偏移量
* @return Cn string
*/
toGanZhi: function (offset) {
return calendar.Gan[offset % 10] + calendar.Zhi[offset % 12];
},
/**
* 传入公历(!)y年获得该年第n个节气的公历日期
* @param y公历年(1900-2100);n二十四节气中的第几个节气(1~24);从n=1(小寒)算起
* @return day Number
* @eg:var _24 = calendar.getTerm(1987,3) ;//_24=4;意即1987年2月4日立春
*/
getTerm: function (y, n) {
if (y < 1900 || y > 2100) {
return -1;
}
if (n < 1 || n > 24) {
return -1;
}
var _table = calendar.sTermInfo[y - 1900];
var _info = [
parseInt('0x' + _table.substr(0, 5)).toString(),
parseInt('0x' + _table.substr(5, 5)).toString(),
parseInt('0x' + _table.substr(10, 5)).toString(),
parseInt('0x' + _table.substr(15, 5)).toString(),
parseInt('0x' + _table.substr(20, 5)).toString(),
parseInt('0x' + _table.substr(25, 5)).toString()
];
var _calday = [
_info[0].substr(0, 1),
_info[0].substr(1, 2),
_info[0].substr(3, 1),
_info[0].substr(4, 2),
_info[1].substr(0, 1),
_info[1].substr(1, 2),
_info[1].substr(3, 1),
_info[1].substr(4, 2),
_info[2].substr(0, 1),
_info[2].substr(1, 2),
_info[2].substr(3, 1),
_info[2].substr(4, 2),
_info[3].substr(0, 1),
_info[3].substr(1, 2),
_info[3].substr(3, 1),
_info[3].substr(4, 2),
_info[4].substr(0, 1),
_info[4].substr(1, 2),
_info[4].substr(3, 1),
_info[4].substr(4, 2),
_info[5].substr(0, 1),
_info[5].substr(1, 2),
_info[5].substr(3, 1),
_info[5].substr(4, 2),
];
return parseInt(_calday[n - 1]);
},
/**
* 传入农历数字月份返回汉语通俗表示法
* @param lunar month
* @return Cn string
* @eg:var cnMonth = calendar.toChinaMonth(12) ;//cnMonth='腊月'
*/
toChinaMonth: function (m) { // 月 => \u6708
if (m > 12 || m < 1) {
return -1
} //若参数错误 返回-1
var s = calendar.nStr3[m - 1];
s += "\u6708"; //加上月字
return s;
},
/**
* 传入农历日期数字返回汉字表示法
* @param lunar day
* @return Cn string
* @eg:var cnDay = calendar.toChinaDay(21) ;//cnMonth='廿一'
*/
toChinaDay: function (d) { //日 => \u65e5
var s;
switch (d) {
case 10:
s = '\u521d\u5341';
break;
case 20:
s = '\u4e8c\u5341';
break;
break;
case 30:
s = '\u4e09\u5341';
break;
break;
default:
s = calendar.nStr2[Math.floor(d / 10)];
s += calendar.nStr1[d % 10];
}
return (s);
},
/**
* 年份转生肖[!仅能大致转换] => 精确划分生肖分界线是“立春”
* @param y year
* @return Cn string
* @eg:var animal = calendar.getAnimal(1987) ;//animal='兔'
*/
getAnimal: function (y) {
return calendar.Animals[(y - 4) % 12]
},
/**
* 农历节日
*/
Njieri: function (month, date) {
var Njieri = null
if ((month == '腊月') && (date == '三十')) {
Njieri = '除夕'
}
if ((month == '正月') && (date == '初一')) {
Njieri = '春节'
}
if ((month == '正月') && (date == '十五')) {
Njieri = '元宵节'
}
if ((month == '二月') && (date == '初二')) {
Njieri = '春龙节'
}
if ((month == '五月') && (date == '初六')) {
Njieri = '立夏节'
}
if ((month == '六月') && (date == '初六')) {
Njieri = '天贶节'
}
if ((month == '七月') && (date == '初七')) {
Njieri = '七夕节'
}
if ((month == '七月') && (date == '十五')) {
Njieri = '中元节'
}
if ((month == '八月') && (date == '十五')) {
Njieri = '中秋节'
}
if ((month == '九月') && (date == '初九')) {
Njieri = '重阳节'
}
if ((month == '腊月') && (date == '初八')) {
Njieri = '腊八节'
}
return Njieri;
},
/**
* 阳历节日
*/
jieri: function (year, month, date) {
var jirri = null
if (month == 5) {
var thisWeek = new Date(year, month - 1, 1).getDay();
if (thisWeek == 0)
thisWeek = 7
var wuyueDay = 1 + 7 + (7 - thisWeek)
if ((month == 5) && (date == wuyueDay)) {
jirri = "母亲节";
}
}
if (month == 6) {
var thisWeek = new Date(year, month - 1, 1).getDay();
if (thisWeek == 0)
thisWeek = 7
var wuyueDay = 1 + 14 + (7 - thisWeek)
if ((month == 6) && (date == wuyueDay)) {
jirri = "父亲节";
}
}
if ((month == 1) && (date == 1)) {
jirri = "元旦";
}
if ((month == 3) && (date == 8)) {
jirri = "妇女节";
}
if ((month == 3) && (date == 12)) {
jirri = "植树节";
}
if ((month == 4) && (date == 5)) {
jirri = "清明节";
}
if ((month == 5) && (date == 1)) {
jirri = "劳动节";
}
if ((month == 5) && (date == 4)) {
jirri = "青年节";
}
if ((month == 6) && (date == 1)) {
jirri = "儿童节";
}
if ((month == 8) && (date == 1)) {
jirri = "建军节";
}
if ((month == 9) && (date == 10)) {
jirri = "教师节";
}
if ((month == 10) && (date == 1)) {
jirri = "国庆节";
}
if ((month == 12) && (date == 24)) {
jirri = "平安夜";
}
if ((month == 12) && (date == 25)) {
jirri = "圣诞节";
}
return jirri
},
/**
* 传入阳历年月日获得详细的公历、农历object信息 <=>JSON
* @param y solar year
* @param m solar month
* @param d solar day
* @return JSON object
* @eg:console.log(calendar.solar2lunar(1987,11,01));
*/
solar2lunar: function (y, m, d) { //参数区间1900.1.31~2100.12.31
//年份限定、上限
if (y < 1900 || y > 2100) {
return -1; // undefined转换为数字变为NaN
}
//公历传参最下限
if (y == 1900 && m == 1 && d < 31) {
return -1;
}
//未传参 获得当天
if (!y) {
var objDate = new Date();
} else {
var objDate = new Date(y, parseInt(m) - 1, d)
}
var i, leap = 0,
temp = 0;
//修正ymd参数
var y = objDate.getFullYear(),
m = objDate.getMonth() + 1,
d = objDate.getDate();
var offset = (Date.UTC(objDate.getFullYear(), objDate.getMonth(), objDate.getDate()) - Date.UTC(1900, 0, 31)) /
86400000;
for (i = 1900; i < 2101 && offset > 0; i++) {
temp = calendar.lYearDays(i);
offset -= temp;
}
if (offset < 0) {
offset += temp;
i--;
}
// 是否是节日
var festival = calendar.jieri(y, m, d)
var isFestival = false
if (festival != null) {
isFestival = true
}
//是否今天
var isTodayObj = new Date(),
isToday = false;
if (isTodayObj.getFullYear() == y && isTodayObj.getMonth() + 1 == m && isTodayObj.getDate() == d) {
isToday = true;
}
//星期几
var nWeek = objDate.getDay(),
cWeek = calendar.nStr1[nWeek];
//数字表示周几顺应天朝周一开始的惯例
if (nWeek == 0) {
nWeek = 7;
}
//农历年
var year = i;
var leap = calendar.leapMonth(i); //闰哪个月
var isLeap = false;
//效验闰月
for (i = 1; i < 13 && offset > 0; i++) {
//闰月
if (leap > 0 && i == (leap + 1) && isLeap == false) {
--i;
isLeap = true;
temp = calendar.leapDays(year); //计算农历闰月天数
} else {
temp = calendar.monthDays(year, i); //计算农历普通月天数
}
//解除闰月
if (isLeap == true && i == (leap + 1)) {
isLeap = false;
}
offset -= temp;
}
// 闰月导致数组下标重叠取反
if (offset == 0 && leap > 0 && i == leap + 1) {
if (isLeap) {
isLeap = false;
} else {
isLeap = true;
--i;
}
}
if (offset < 0) {
offset += temp;
--i;
}
//农历月
var month = i;
//农历日
var day = offset + 1;
//天干地支处理
var sm = m - 1;
var gzY = calendar.toGanZhiYear(year);
// 当月的两个节气
// bugfix-2017-7-24 11:03:38 use lunar Year Param `y` Not `year`
var firstNode = calendar.getTerm(y, (m * 2 - 1)); //返回当月「节」为几日开始
var secondNode = calendar.getTerm(y, (m * 2)); //返回当月「节」为几日开始
// 依据12节气修正干支月
var gzM = calendar.toGanZhi((y - 1900) * 12 + m + 11);
if (d >= firstNode) {
gzM = calendar.toGanZhi((y - 1900) * 12 + m + 12);
}
//传入的日期的节气与否
var isTerm = false;
var Term = null;
if (firstNode == d) {
isTerm = true;
Term = calendar.solarTerm[m * 2 - 2];
}
if (secondNode == d) {
isTerm = true;
Term = calendar.solarTerm[m * 2 - 1];
}
//日柱 当月一日与 1900/1/1 相差天数
var dayCyclical = Date.UTC(y, sm, 1, 0, 0, 0, 0) / 86400000 + 25567 + 10;
var gzD = calendar.toGanZhi(dayCyclical + d - 1);
//该日期所属的星座
var astro = calendar.toAstro(m, d);
var Njieri = calendar.Njieri((isLeap ? "\u95f0" : '') + calendar.toChinaMonth(month), calendar.toChinaDay(day));
var isNjieri = false;
if (Njieri != null) {
isNjieri = true
}
return {
'lYear': year,
'lMonth': month,
'lDay': day,
'Animal': calendar.getAnimal(year),
'IMonthCn': (isLeap ? "\u95f0" : '') + calendar.toChinaMonth(month),
'IDayCn': calendar.toChinaDay(day),
'cYear': y,
'cMonth': m,
'cDay': d,
'gzYear': gzY,
'gzMonth': gzM,
'gzDay': gzD,
'isToday': isToday,
'isLeap': isLeap,
'nWeek': nWeek,
'ncWeek': "\u661f\u671f" + cWeek,
'isTerm': isTerm,
'Term': Term,//节气
'astro': astro,//星座
'festival': festival,//阳历节日
'isFestival': isFestival,
'Njieri': Njieri,
'isNjieri': isNjieri
};
},
/**
* 传入农历年月日以及传入的月份是否闰月获得详细的公历、农历object信息 <=>JSON
* @param y lunar year
* @param m lunar month
* @param d lunar day
* @param isLeapMonth lunar month is leap or not.[如果是农历闰月第四个参数赋值true即可]
* @return JSON object
* @eg:console.log(calendar.lunar2solar(1987,9,10));
*/
lunar2solar: function (y, m, d, isLeapMonth) { //参数区间1900.1.31~2100.12.1
var isLeapMonth = !!isLeapMonth;
var leapOffset = 0;
var leapMonth = calendar.leapMonth(y);
var leapDay = calendar.leapDays(y);
if (isLeapMonth && (leapMonth != m)) {
return -1;
} //传参要求计算该闰月公历 但该年得出的闰月与传参的月份并不同
if (y == 2100 && m == 12 && d > 1 || y == 1900 && m == 1 && d < 31) {
return -1;
} //超出了最大极限值
var day = calendar.monthDays(y, m);
var _day = day;
//bugFix 2016-9-25
//if month is leap, _day use leapDays method
if (isLeapMonth) {
_day = calendar.leapDays(y, m);
}
if (y < 1900 || y > 2100 || d > _day) {
return -1;
} //参数合法性效验
//计算农历的时间差
var offset = 0;
for (var i = 1900; i < y; i++) {
offset += calendar.lYearDays(i);
}
var leap = 0,
isAdd = false;
for (var i = 1; i < m; i++) {
leap = calendar.leapMonth(y);
if (!isAdd) { //处理闰月
if (leap <= i && leap > 0) {
offset += calendar.leapDays(y);
isAdd = true;
}
}
offset += calendar.monthDays(y, i);
}
//转换闰月农历 需补充该年闰月的前一个月的时差
if (isLeapMonth) {
offset += day;
}
//1900年农历正月一日的公历时间为1900年1月30日0时0分0秒(该时间也是本农历的最开始起始点)
var stmap = Date.UTC(1900, 1, 30, 0, 0, 0);
var calObj = new Date((offset + d - 31) * 86400000 + stmap);
console.log(calObj)
var cY = calObj.getUTCFullYear();
var cM = calObj.getUTCMonth() + 1;
var cD = calObj.getUTCDate();
return calendar.solar2lunar(cY, cM, cD);
}
};
return calendar.solar2lunar(y, m, d)
}
module.exports = {
chajie: chajie
}
\ No newline at end of file
// components/Calendar/Calendar.js
const app = getApp();
var clientImgPath = app.globalData.clientImgPath;
var img_host = app.globalData.ImgPath;
var staticUrl=app.globalData.staticUrl;
import {formatZero} from "../../utils/util";
import {
sign,
getSignLists
} from '../../api/community';
Component({
/**
* 组件的属性列表
*/
properties: {
signdates:{
type:Array,
value:[],
},
sendYear: {
type: Number,
value: new Date().getFullYear()
},
sendMonth: {
type: Number,
value: new Date().getMonth() + 1
},
dataSource: { //已签到的数据源
type: Array,
value: []
},
langType: { //只是示例一个翻译而已,要想所有都翻译自己可以再加加
type: String,
value: 'ch'
},
},
observers: {
'signdates': function(field) {
this.properties.signdates = field
},
},
attached() {
// this.data.cur_year = this.properties.sendYear;
// this.data.cur_month = this.properties.sendMonth;
// this.data.SignUp = this.properties.dataSource;
console.log(this.data.days)
console.log(this.properties.signdates)
this.setData({
cur_year: this.properties.sendYear,
cur_month: this.properties.sendMonth,
})
this.calculateEmptyGrids(this.data.cur_year, this.data.cur_month);
this.calculateDays(this.data.cur_year, this.data.cur_month);
this.onJudgeSign();
},
watch: {
dataSource: 'onResChange',
},
/**
* 组件的初始数据
*/
data: {
days: [],
SignUp: [],
cur_year: 0, //当前选的年
cur_month: 0, //当前选的月
today: parseInt(new Date().getDate()), //本日
toMonth: parseInt(new Date().getMonth() + 1), //本月
toYear: parseInt(new Date().getFullYear()), //本年
weeks_ch: ['', '', '', '', '', '', ''],
weeks_en: ['Sun', 'Mon', 'Tues', 'Wed', 'Thur', 'Fri', 'Sat'],
total_count:'',
showeggs:true,
clientImgPath,
img_host,
staticUrl,
},
/**
* 组件的方法列表
*/
methods: {
alreadySign(){
wx.showToast({
title: '不能重复签到',
icon:'none'
})
},
beforesign(){
wx.showToast({
title: '还未开启签到',
icon:'none'
})
},
// 获取当月共多少天
getThisMonthDays(year, month) {
return new Date(year, month, 0).getDate()
},
// 获取当月第一天星期几
getFirstDayOfWeek(year, month) {
return new Date(Date.UTC(year, month - 1, 1)).getDay();
},
// 计算当月1号前空了几个格子,把它填充在days数组的前面
calculateEmptyGrids(year, month) {
//计算每个月时要清零
this.setData({
days: []
})
const firstDayOfWeek = this.getFirstDayOfWeek(year, month);
if (firstDayOfWeek > 0) {
for (let i = 0; i < firstDayOfWeek; i++) {
var obj = {
date: null,
isSign: false
}
this.data.days.push(obj);
}
this.setData({
days: this.data.days
})
}
},
// 绘制当月天数占的格子,并把它放到days数组中
calculateDays(year, month) {
this.triggerEvent('counts',this.data.total_count)
let that = this
console.log(year, month)
const thisMonthDays = this.getThisMonthDays(year, month);
// this.columnsLen=Math.ceil(thisMonthDays/7);
// console.log(this.columnsLen);
for (let i = 1; i <= thisMonthDays; i++) {
var obj = {
date: i,
isSign: false
}
this.data.days.push(obj);
// this.setData({
// days:this.data.days.push(obj)
// })
}
console.log(this.properties.dataSource)
getSignLists({
month:`${year}-${formatZero(month,2)}`
}).then(res=>{
if(res.code == 0){
let daysdata = res.data.list
// console.log(daysdata)
this.data.days.map((item)=>{
// console.log(item)
daysdata.map((itm)=>{
if(item.date == itm.day){
item.isSign = true
}
})
})
this.setData({
days: this.data.days,
total_count:res.data.total_count
})
this.triggerEvent('counts',this.data.total_count)
}
})
},
onResChange(newD, oldD) {
this.SignUp = newD;
this.onJudgeSign();
},
//匹配判断当月与当月哪些日子签到打卡
onJudgeSign() {
var signs = this.data.SignUp;
var daysArr = this.data.days;
for (var i = 0; i < signs.length; i++) {
var current = new Date(signs[i].replace(/-/g, "/"));
var year = current.getFullYear();
var month = current.getMonth() + 1;
var day = current.getDate();
day = parseInt(day);
for (var j = 0; j < daysArr.length; j++) {
//年月日相同则打卡成功
if (year == this.cur_year && month == this.cur_month && daysArr[j].date == day) { //&& signs[i].isSign == "今日已打卡"
// console.log(daysArr[j].date, day);
daysArr[j].isSign = true;
}
}
}
// this.days = daysArr;
this.setData({
days: daysArr
})
},
// 切换控制年月,上一个月,下一个月
handleCalendar(event) {
var type = event.currentTarget.dataset.type;
const cur_year = parseInt(this.data.cur_year);
const cur_month = parseInt(this.data.cur_month);
var newMonth;
var newYear = cur_year;
if (type === 0) { //上个月
// console.log(111111111111111111111111)
newMonth = cur_month - 1;
if (newMonth < 1) {
newYear = cur_year - 1;
newMonth = 12;
}
} else {
newMonth = cur_month + 1;
if (newMonth > 12) {
newYear = cur_year + 1;
newMonth = 1;
}
}
this.calculateEmptyGrids(newYear, newMonth);
this.calculateDays(newYear, newMonth);
// this.data.cur_year = newYear;
// this.data.cur_month = newMonth;
// this.data.SignUp = []; //先清空
this.setData({
cur_year: newYear,
cur_month: newMonth,
SignUp: []
})
this.triggerEvent('dateChange', this.data.cur_year + "-" + this.data.cur_month); //传给调用模板页面去拿新数据
},
// clickSignUp(date, type)
clickSignUp(value) { //type=0补签,type=1当日签到
console.log(value.currentTarget.dataset.index)
let type = value.currentTarget.dataset.type
let date = value.currentTarget.dataset.date
let index = value.currentTarget.dataset.index
// return false
var str = "签到";
if (type == 0) { //如果不需要补签功能直接在这阻止不执行后面的代码就行。
// str = "补签";
wx.showToast({
title: '不支持补签',
icon: 'none',
});
return false
}
sign({
sign_status: 1
}).then(res => {
if (res.code == 0) {
// wx.showToast({
// title: str + "成功" + date + "号",
// icon: 'success',
// duration: 2000
// });
this.data.days[index].isSign = true
this.setData({
days: this.data.days
})
// console.log(this.SignUp);
// this.$forceUpdate();
this.triggerEvent('popshows',this.data.showeggs)
this.triggerEvent('counts',this.data.total_count+3)
// this.triggerEvent('popshows',this.data.showeggs)
console.log(this.data.total_count+3)
this.triggerEvent('clickChange', this.data.cur_year + "-" + this.data.cur_month + "-" + date); //传给调用模板页面
//refresh
this.onJudgeSign();
} else {
wx.showToast({
title: res.msg,
icon: 'none'
});
}
})
// console.log(this.data.SignUp)
// this.data.SignUp.push(this.data.cur_year + "-" +this.data.cur_month + "-" + date); //自动加假数据,写了接口就不用了
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!-- 打卡日历页面 -->
<view class='all'>
<view class="" style="color: #757575;font-size: 24rpx;width: 100%;text-align: center;padding: 25px 0 0 0;">
每日签到可领取3个,进店与店长核销后即可领取
</view>
<view class="bar">
<!-- 上一个月 -->
<view class="previous" bindtap="handleCalendar" data-type="{{0}}">
<button class="barbtn" wx:if="{{langType=='ch'}}">上一月</button>
<button class="barbtn" wx:else>Last</button>
</view>
<!-- 显示年月 -->
<view class="date">{{cur_year || "--"}} 年 {{cur_month || "--"}} 月</view>
<!-- 下一个月 -->
<view class="next" bindtap="handleCalendar" data-type="{{1}}">
<button class="barbtn" wx:if="{{langType=='ch'}}">下一月</button>
<button class="barbtn" wx:else>Next</button>
</view>
</view>
<!-- 显示星期 -->
<view class="week" wx:if="{{langType=='ch'}}">
<view wx:for="{{weeks_ch}}" wx:for-item="item" wx:key="index">{{item}}</view>
</view>
<view class="week" wx:else>
<view wx:for="{{weeks_en}}" wx:for-item="item" wx:key="index">{{item}}</view>
</view>
<view class="myDateTable">
<view wx:for="{{days}}" wx:for-item="item" wx:key="index" class='dateCell'>
<view wx:if="{{item.date==undefined||item.date == null}}" class='cell bgWhite F64'>
<image src=""></image>
<view></view>
</view>
<view wx:else>
<!-- 已签到日期 -->
<view wx:if="{{item.isSign == true}}" class='cell bgWhite F64' bindtap="alreadySign">
<!-- <text>{{item.date}}</text> -->
<image src="{{clientImgPath}}/images/sign/yili.png"></image>
<view wx:if="{{item.date==today&&cur_month==toMonth&&cur_year==toYear}}" style="font-weight: bold;">今日</view>
<view wx:else >{{item.date}}</view>
</view>
<!-- 漏签 -->
<view bindtap="clickSignUp" class="cell bgGray F64" data-index="{{index}}" data-date="{{item.date}}" data-type="{{0}}"
wx:elif="{{cur_year<toYear||(cur_year==toYear&&cur_month<toMonth)||(cur_year==toYear&&cur_month==toMonth&&item.date<today)}}">
<!-- 小程序不兼容这个 wx:else-if="(new Date(cur_year+'-'+cur_month+'-'+item.date))<(new Date())"> -->
<!-- <text >{{item.date}}</text> -->
<image src="{{clientImgPath}}/images/sign/weili.png"></image>
<view>{{item.date}}</view>
</view>
<!-- 今日未签到-->
<view bindtap="clickSignUp" data-date="{{item.date}}" data-index="{{index}}" data-type="{{1}}" class="cell F64 bgBlue" wx:elif="{{item.date==today&&cur_month==toMonth&&cur_year==toYear}}">
<!-- <text>签到</text> -->
<image src="{{clientImgPath}}/images/sign/qiandao.png"></image>
<view style="font-weight: bold">今日</view>
</view>
<!-- 当前日期之后 -->
<view class="F64 cell" wx:else bindtap="beforesign">
<!-- <text>{{item.date}}</text> -->
<image src="{{clientImgPath}}/images/sign/qiandao.png"></image>
<view>{{item.date}}</view>
</view>
</view>
</view>
</view>
</view>
<view class="TipArea ">
<view> 联系电话:13367001917</view>
<view>领取地址:鹿马生活超市 南昌县莲塘镇澄湖西路2137号</view>
</view>
<view hidden="{{false}}">
<!-- <view style="height:100%;width:100%">
</view> -->
<image src="{{clientImgPath}}/images/sign/pop.png"></image>
</view>
/* components/Calendar/Calendar.wxss */
.all {
margin-top: 20rpx;
background-color: #FFFFFF;
border-radius: 20rpx;
padding-bottom: 34rpx;
}
.all .bar {
display: flex;
flex-direction: row;
justify-content: space-between;
margin: 30rpx 20rpx;
padding: 10rpx;
}
.bar .barbtn {
height: 30px;
line-height: 30px;
font-size: 12px;
}
.all .week {
display: flex;
flex-direction: row;
justify-content: space-between;
/* padding: 14rpx; */
padding-left: 50rpx;
padding-right: 60rpx;
/* margin: 20rpx; */
border-radius: 10px;
background-color: #fff;
}
.myDateTable {
margin: 2.5vw;
/* padding: 0 5vw 5vw 5vw; */
border-radius: 10px;
/* background: linear-gradient(#74AADA, #94db98); */
}
.myDateTable .dateCell {
width: 9vw;
padding: 1vw;
display: inline-block;
text-align: center;
font-size: 16px;
margin: 16rpx 7rpx 0 7rpx;
}
.dateCell .cell {
/* display: flex; */
border-radius: 50%;
height: 9vw;
justify-content: center;
align-items: center;
}
.whiteColor {
color: #fff;
}
.greenColor {
color: #f64f15;
font-weight: bold;
}
.bgWhite {
background-color: #fff;
}
.bgGray {
background-color: rgba(255, 255, 255, 0.42);
}
.bgBlue {
font-size: 14px;
background-color: #4b95e6;
}
.redColor {
color: #f64f15;
}
.TipArea {
word-break: break-all;
word-wrap: break-word;
font-size: 26rpx;
padding: 10px;
color: #757575;
}
.impTip {
display: inline-block;
color: #ff0000;
}
.F64 {
color: #f64f15;
}
\ No newline at end of file
// components/CouponGroup/CouponGroup.js
Component({
/**
* 组件的属性列表
*/
properties: {
// 列表
List:{
type: Array,
value: []
}
},
/**
* 组件的初始数据
*/
data: {
type:0,
num:true,
currentIndex:0,
},
ready(){
},
/**
* 组件的方法列表
*/
methods: {
getTapAndPay:function(e){
// console.info(e,'aaaaaaaaaaaaa')
let List_id = e.currentTarget.dataset.list_id;
this.triggerEvent('getTapAndPay',{List_id:List_id});
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--components/CouponGroup/CouponGroup.wxml-->
<view class="dsfl mb-30" wx:for='{{List}}' data-list_id="{{index}}" bindtap="getTapAndPay" wx:key='index'>
<view class="zile dsfl" >
<view class="byuan" style="top:-5rpx"></view>
<view class="byuans" style="bottom:-5rpx"></view>
<view class="zl-l">
<text class="sz-60">{{item.money}}</text><text class="sz-24">元</text>
</view>
<view class="zl-r">
<view class="sz-28">{{item.coupon_name}}</view>
<view class="sz-20">满{{item.at_least}}减{{item.money}}元</view>
<view class="sz-20">有效期:{{item.end_time}}</view>
</view>
</view>
<view class="zire1" wx:if="{{item.is_get==0}}">
<view>
<view >立即领取</view>
<view style="font-size:24rpx;" wx:if='{{item.resNum>0}}'>(已领取{{item.resNum}}张)</view>
<view style="font-size:24rpx;" wx:if='{{item.resNum==0}}'>(还未领取)</view>
</view>
</view>
<view class="zire" wx:if="{{item.is_get==1}}">
<text style="z-index:1">已领取</text>
<view class="ylingqu">
<image src="{{clientImgPath}}/images/images/ylingqu.png"></image>
</view>
</view>
</view>
\ No newline at end of file
/* components/CouponGroup/CouponGroup.wxss */
/* xin */
.dsfl{
display: flex;
}
.mb-30{
margin-bottom: 30rpx;
}
.zile{
flex: 1;
padding: 15rpx 20rpx;
border-radius: 10rpx;
background:rgba(255,241,222,1);
border-top-left-radius: 6rpx;
border-bottom-left-radius: 6rpx;
border:1px solid #EC9367;
position: relative;
border-right: 4rpx dashed rgba(236,147,103,1);
display: flex;
align-items: center;
}
.zl-l{
display:table-cell;
vertical-align:bottom;
color: #F2722D;
}
.sz-60{
font-size: 60rpx;font-weight: 800;
}
.sz-24{
font-size: 24rpx;font-weight: 500;
}
.zl-r{
margin-left: 20rpx;flex: 1;color: #F2722D;
}
.sz-28{
font-size: 28rpx;font-weight: 600;
}
.sz-20{
font-size: 20rpx;font-weight: 500;margin-top: 10rpx;
}
.zire{
width:170rpx;
position: relative;
border-bottom-right-radius: 6rpx;
border-top-right-radius: 6rpx;
background:rgba(255,241,222,1);
border:2rpx solid rgba(236,147,103,1);
border-left: 0;display: flex;align-items: center;justify-content: center;
font-size:30rpx;
font-weight:600;
color:rgba(242,114,45,1);
border-radius: 10rpx;
}
.zire1{
width:170rpx;
display: flex;
align-items: center;
justify-content: center;
position: relative;
border-bottom-right-radius: 6rpx;
border-top-right-radius: 6rpx;
background:rgba(255,241,222,1);
border:2rpx solid rgba(236,147,103,1);
border-left: 0;text-align: center;
font-size:30rpx;
font-weight:600;
color:rgba(242,114,45,1);
border-radius: 10rpx;
}
.byuan{
width: 20rpx;height: 10rpx;border-radius: 0 0 20rpx 20rpx;background-color: #fff;position: absolute;right: -13rpx;border-bottom: 1px solid #EC9367;z-index: 9;
}
.byuans{
width: 20rpx;height: 10rpx;border-radius: 20rpx 20rpx 0 0;background-color: #fff;position: absolute;right: -13rpx;border-top: 1px solid #EC9367;z-index: 9;
}
.ylingqu{
width: 80rpx;height: 70rpx;position: absolute;bottom:0;right: 0;z-index: 0;
}
\ No newline at end of file
// components/CouponPopup/CouponPopup.js
Component({
properties: {
},
data: {
flag:false,
wrapAnimate:'wrapAnimate',
bgOpacity:0,
frameAnimate:'frameAnimate',
},
methods: {
showFrame() {
this.setData({ flag: true, wrapAnimate: 'wrapAnimate', frameAnimate: 'frameAnimate' });
},
hideFrame() {
const that= this;
that.setData({ wrapAnimate: 'wrapAnimateOut', frameAnimate: 'frameAnimateOut' });
setTimeout(()=>{
that.setData({ flag: false})
},400)
},
catchNone(){
//阻止冒泡
},
_showEvent() {
this.triggerEvent("showEvent");
},
_hideEvent() {
this.triggerEvent("hideEvent");
}
}
})
{
"component": true,
"usingComponents": {
"CouponGroup":"/components/CouponGroup/CouponGroup"
}
}
\ No newline at end of file
<!--components/CouponPopup/CouponPopup.wxml-->
<view wx:if='{{flag}}'>
<view class='wrap {{wrapAnimate}}' style='background:rgba(0,0,0,{{bgOpacity}});'></view>
<view catchtap='hideFrame' class='frame-wrapper {{frameAnimate}}'>
<view catchtap='catchNone' class='frame'>
<!-- 标题 -->
<view class='title-wrapper tect'>
<view class="btext">鹿马108优惠</view>
<view class="btxia">领取优惠券</view>
<!-- <image catchtap='hideFrame' src='/image/compare-cuo.png' mode='widthFix'></image> -->
</view>
<!-- 内容 -->
<!-- <slot></slot> -->
<view class="kuai">
<CouponGroup />
</view>
<view class="botton" catchtap='hideFrame'>完成</view>
</view>
</view>
</view>
/* components/CouponPopup/CouponPopup.wxss */
.wrapAnimate{animation: wrapAnimate 0.5s ease-in-out forwards}
@keyframes wrapAnimate{
0%{}
100%{background:rgba(0,0,0,0.35);}
}
.wrapAnimateOut{animation: wrapAnimateOut 0.4s ease-in-out forwards}
@keyframes wrapAnimateOut{
0%{background:rgba(0,0,0,0.35);}
100%{background:rgba(0,0,0,0);}
}
.frameAnimate{animation: frameAnimate 0.5s ease forwards;}
@keyframes frameAnimate{
0%{}
100%{opacity: 1;top:0vh;}
}
.frameAnimateOut{animation: frameAnimateOut 0.4s ease forwards;}
@keyframes frameAnimateOut{
0%{opacity: 1;top:0vh;}
100%{opacity: 0;top:100vh;}
}
.frame-wrapper{position: fixed;height:100vh;width:100vw;z-index: 999;top: 50vh;}
.frame{background: #fff;position: absolute;bottom: 0;width: 88.2vw;padding: 5.9vw 5.9vw 0;border-top-left-radius: 20rpx;border-top-right-radius: 20rpx;z-index: 999;}
.title-wrapper{justify-content: space-between;font-size: 4.9vw;color: #4a4a4a;margin-bottom: 5.9vw;}
.title-wrapper>image{width:3.2vw;height:3.2vw;padding:0 5vw;margin-right:-5vw;}
.flex{display: flex;align-items: center;}
.wrap{position: fixed;z-index: 1;top: 0;left: 0;right: 0;bottom: 0;}
.tect{
text-align: center;
}
.btext{font-size:36rpx;
font-weight:800;
color:rgba(26,26,26,1);}
.btxia{
font-size:24rpx;
font-weight:500;
color:rgba(128,128,128,1);
}
.kuai{
max-height: 550rpx;overflow-x:hidden;
}
.botton{
width:100%;
height:88rpx;
background:rgba(255,105,0,1);
border-radius:10rpx;
font-size:40rpx;
font-weight:800;
color:rgba(255,255,255,1);
line-height: 88rpx;
margin-top: 40rpx;
margin-bottom: 40rpx;
text-align: center;
}
\ No newline at end of file
// components/CouponsGroup/CouponsGroup.js
import {
my_coupons,
del_coupons
} from '../../api/user.js';
let app = getApp();
var clientImgPath = app.globalData.clientImgPath;
Component({
/**
* 组件的属性列表
*/
properties: {
coupons: {
type: Array, //类型
value: 'default value' //默认值
},
currentTab: {
type: Number, //类型
value: 0 //默认值
},
// 头部分类
currentTabs: {
type: Number, //类型
value: 0 //默认值
},
},
/**
* 组件的初始数据
*/
data: {
coupons: [],
pageNum: 0,
show: false,
clientImgPath:clientImgPath,
},
/**
* 组件的方法列表
*/
methods: {
getCoupon(e) {
// console.log(e);
//e.currentTarget.dataset.index
let bianli = e.currentTarget.dataset.index;
this.triggerEvent('getCoupon', {
shop_id: this.data.coupons[bianli].shop_id,
goods_id: this.data.coupons[bianli].goods_id,
id: this.data.coupons[bianli].id
})
},
xiangqing: function (e) {
let bianlss = e.currentTarget.dataset.index;
this.setData({
show: !this.data.show,
bianlss: bianlss
})
},
onDel: function (e) {
console.info(e)
let bianl = e.currentTarget.dataset.index;
this.setData({
bianl
})
console.log(bianl)
let coupons_id = this.data.coupons[bianl].id;
console.log(coupons_id)
var that = this;
app.showModal({
content: "确定要删除此券",
showCancel: true,
confirm: function () {
// console.log("few")
if (coupons_id) {
del_coupons(coupons_id).then(res => {
if (res.code == 0) {
wx.showToast({
title: res.msg,
duration: 2000,
})
}
// that.data.pageNum = 0;
that.data.couponlist = [];
that.data.coupons = [];
that.setData({
couponList: that.data.couponlist,
coupons: that.data.coupons,
// pageNum: that.data.pageNum,
})
that.my_coupons()
// that.triggerEvent('initializedata',that.data.bianl)
})
}
},
})
// let kaiguan = e.currentTarget.dataset.index;
// let coupons = this.data.coupons;
// console.log(coupons)
// coupons[kaiguan].isshowall = !coupons[kaiguan].isshowall;
// console.log(coupons[kaiguan].isshowall)
// this.setData({
// coupons
// })
},
// handleLongPress(e) {
// console.log(e, 12121212121)
// let bianl = e.currentTarget.dataset.index;
// this.setData({
// bianl
// })
// console.log(bianl)
// let coupons_id = this.data.coupons[bianl].id;
// console.log(coupons_id)
// var that = this;
// app.showModal({
// content: "确定要删除此券",
// showCancel: true,
// confirm: function () {
// // console.log("few")
// if (coupons_id) {
// del_coupons(coupons_id).then(res => {
// if (res.code == 0) {
// wx.showToast({
// title: res.msg,
// duration: 2000,
// })
// }
// // that.data.pageNum = 0;
// that.data.couponlist = [];
// that.data.coupons = [];
// that.setData({
// couponList: that.data.couponlist,
// coupons: that.data.coupons,
// // pageNum: that.data.pageNum,
// })
// that.my_coupons()
// // that.triggerEvent('initializedata',that.data.bianl)
// })
// }
// },
// })
// },
my_coupons() {
var that = this;
console.log(that.data.currentTabs)
console.log(that.data.currentTab)
if (that.data.currentTabs == 0) {
if (this.data.currentTab == 0) {
var type = 0;
var page = 0;
var genre = 1;
my_coupons(type, page, genre).then(res => {
if (res.code == 0) {
console.log(res.data)
console.log(res)
// var coupon_list = res.data
var coupons = res.data
that.setData({
// couponList: coupon_list,
coupons
})
}
})
} else {
var type = 0;
var page = 0;
var genre = 0;
my_coupons(type, page, genre).then(res => {
if (res.code == 0) {
var coupons = res.data
that.setData({
coupons
})
}
})
}
} else if (that.data.currentTabs == 1) {
if (this.data.currentTab == 0) {
var type = 1;
var page = 0;
var genre = 1;
my_coupons(type, page, genre).then(res => {
if (res.code == 0) {
var coupons = res.data
that.setData({
coupons
})
}
// wx.hideLoading();
})
} else {
console.log(that.data.pageNum)
var type = 1;
var page = 0;
var genre = 0;
my_coupons(type, page, genre).then(res => {
if (res.code == 0) {
console.log(res.data)
console.log(res)
var coupons = res.data
that.setData({
coupons
})
}
})
}
} else if (that.data.currentTabs == 2) {
if (this.data.currentTab == 0) {
var type = 2;
var page = 0;
var genre = 1;
my_coupons(type, page, genre).then(res => {
if (res.code == 0) {
console.log(res.data)
var coupons = res.data
that.setData({
coupons
})
}
})
} else {
var type = 2;
var page = 0;
var genre = 0;
my_coupons(type, page, genre).then(res => {
if (res.code == 0) {
var coupons = res.data
that.setData({
coupons
})
}
})
}
}
},
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--components/CouponsGroup/CouponsGroup.wxml-->
<view class="mab-30 kbox {{item.type==2||item.type==1?'huse':''}} " wx:for='{{coupons}}' wx:key='key'>
<view bindlongpress="onDel" data-index="{{index}}" >
<view class="dsfle">
<view class="lezi">
<!-- 优惠券过期 -->
<view class="ysyong" wx:if='{{item.type==2}}'>
<image src="{{clientImgPath}}/images/images/yiguoqil.png"></image>
</view>
<view class="ysyong" wx:if='{{item.type==1}}'>
<image src="{{clientImgPath}}/images/images/yishiyong.png"></image>
</view>
<view class="dsfle-a">
<view class="juxing hong">商户</view>
<view class="mjtext" wx:if='{{item.coupon_name==""}}'>{{item.shop_name}}</view>
<view class="mjtext" wx:else >{{item.coupon_name}}</view>
</view>
<view class="xztext">仅限于{{item.shop_name}}店铺内使用</view>
<view class="dsfle-a s-30">
<view class="rqtext">有效期至 {{item.end_time}}</view>
<view class="xqbtn" bindtap="xiangqing" data-index='{{index}}'>详情</view>
</view>
</view>
<view class="rezi">
<view style="width:100%">
<view class="rh1">{{item.money}}元</view>
<view class="rh2">满{{item.at_least}}元使用</view>
<view class="rh3" bindtap='getCoupon' data-index="{{index}}" wx:if='{{item.type==0}}'>立即使用</view>
</view>
</view>
</view>
<view class="smtext {{bianlss==index?'back':'none'}} {{show?'back':'none'}}" >
<view>使用说明:</view>
1.本券有效期至{{item.end_time}}。
2.本券每人限领1张,单笔订单限用1张且仅限移动端使用,不可叠加使用,不找零,不兑现。
3.如用券订单交易取消,券退回账户;如部分交易取消,券优惠按商品金额拆分。
4.商品固定余额部分不参与优惠。
5.若发现多笔订单中用户ID、收货人姓名、详细地址、联系方式及与用户身份相关的其他信息,任意一项或数项存在相同相似,或其他非真实有效等情形的,视为黄牛订单,鹿马108有权取消订单并不予发货。
<!-- 6.{{item.money}}元优惠券 -->
</view>
<!-- 优惠劵 -->
<view class="butt" hidden="{{!item.isshowall}}">
<!-- <view class="butt_1">取消</view> -->
<view class="butt_1" bindtap="handleLongPress" data-index="{{index}}">删除</view>
</view>
</view>
</view>
\ No newline at end of file
/* components/CouponsGroup/CouponsGroup.wxss */
/* 新的 */
.mab-30{
margin-bottom: 30rpx;
}
.dsfle{
display: flex;
}
.dsfle-a{
display: flex;align-items: center;
}
.lezi{
flex: 1;padding: 20rpx 20rpx 20rpx 0;box-sizing: border-box;position: relative;
}
.ysyong{
position: absolute;
width: 136rpx;
height: 136rpx;
right: -68rpx;
bottom: 50%;
z-index: 999;
margin-bottom: -68rpx;
}
.butt{
display: flex;
justify-content: flex-end;
/* margin: 0 20rpx 20rpx 0; */
margin-top: 20rpx;
}
.butt_1{
padding: 10rpx 35px 10rpx 35px;
/* border: 1rpx solid red; */
border-radius: 10rpx;
margin: 0 10rpx 20rpx 0;
background: #f64f15;
color:#ffffff;
font-weight: bold
}
.rezi{
width: 220rpx;padding: 20rpx 0;box-sizing: border-box;display: flex;align-items: center;
position: relative;background-color: #f64f15;text-align: center;
}
.rezi::after{
content: '';
display: block;
width: 40px;
height: 100%;
/* height: 132px; */
background-size: 17px 11px;
background-repeat: repeat-y;
background-image: -o-radial-gradient(#fff 14rpx, transparent 14rpx);
background-image: -webkit-radial-gradient(#fff 14rpx, transparent 14rpx);
/* background-image: radial-gradient(#F5F2F2 8px, transparent 8px); */
position: absolute;
top:0;
left: -22rpx;
}
/* .byuan{
width: 20rpx;height: 20rpx;border-radius: 0 20rpx 20rpx 0;background-color: #fff;position: absolute;left: -10rpx;
} */
.juxing{
padding: 1px 2px;
font-size:24rpx;
font-weight:500;
color:rgba(255,255,255,1);
}
.kbox{
background:rgba(255,255,255,1);
border-radius:12rpx;overflow: hidden;padding: 0 0 0 20rpx ;
}
.hong{
background:rgba(242,45,71,1);
}
.mjtext{
flex: 1;
font-size:32rpx;
font-weight:600;
color:rgba(26,26,26,1);margin-left: 10rpx;
}
.xztext{
font-size:24rpx;
font-weight:500;
color:rgba(179,179,179,1);margin-top: 15rpx;
}
.rqtext{
font-size:24rpx;
font-weight:500;
color:rgba(128,128,128,1);
}
.xqbtn{
margin-left: 20rpx;
padding: 1px 2px;
border:1px solid rgba(153,153,153,1);
border-radius:8rpx;
font-size:18rpx;
font-weight:500;
color:rgba(179,179,179,1);
}
.s-30{
margin-top: 30rpx;
}
.rh1{
font-size:48rpx;
font-weight:bold;
color:rgba(255,255,255,1);
}
.rh2{
font-size:20rpx;
font-weight:500;
color:rgba(255,255,255,1);
margin: 10rpx 0;
}
.rh3{
width:140rpx;
height:46rpx;
text-align: center;
background:rgba(255,255,255,1);
font-size:24rpx;
font-weight:400;
color:rgba(255,105,0,1);
line-height:46rpx;
margin: 0 auto;
}
.smtext{
margin: 20rpx 0;
font-size:17rpx;
font-weight:500;
color:rgba(51,51,51,1);
line-height:24rpx;
padding-right: 20rpx;
box-sizing: border-box;
}
.huse{
-webkit-filter: grayscale(100%);
}
.none{
display: none;
}
.back{
display: initial-back;
}
\ No newline at end of file
// components/ShareGroup/share.js
const app = getApp();
var clientImgPath = app.globalData.clientImgPath;
Component({
properties: {
},
data: {
flag:false,
wrapAnimate:'wrapAnimate',
bgOpacity:0,
frameAnimate:'frameAnimate',
clientImgPath,
},
methods: {
eventDraw () {
wx.showLoading({
title: '绘制分享图片中',
mask: true
})
this.setData({
painting: {
width: 375,
height: 555,
clear: true,
views: [
{
type: 'image',
url: 'https://hybrid.xiaoying.tv/miniprogram/viva-ad/1/1531103986231.jpeg',
top: 0,
left: 0,
width: 375,
height: 555
},
{
type: 'image',
url: 'https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83epJEPdPqQVgv6D8bojGT4DrGXuEC4Oe0GXs5sMsN4GGpCegTUsBgL9SPJkN9UqC1s0iakjQpwd4h4A/132',
top: 27.5,
left: 29,
width: 55,
height: 55
},
{
type: 'image',
url: 'https://hybrid.xiaoying.tv/miniprogram/viva-ad/1/1531401349117.jpeg',
top: 27.5,
left: 29,
width: 55,
height: 55
},
{
type: 'text',
content: '您的好友【kuckboy】',
fontSize: 16,
color: '#402D16',
textAlign: 'left',
top: 33,
left: 96,
bolder: true
},
{
type: 'text',
content: '发现一件好货,邀请你一起0元免费拿!',
fontSize: 15,
color: '#563D20',
textAlign: 'left',
top: 59.5,
left: 96
},
{
type: 'image',
url: 'https://hybrid.xiaoying.tv/miniprogram/viva-ad/1/1531385366950.jpeg',
top: 136,
left: 42.5,
width: 290,
height: 186
},
{
type: 'image',
url: 'https://hybrid.xiaoying.tv/miniprogram/viva-ad/1/1531385433625.jpeg',
top: 443,
left: 85,
width: 68,
height: 68
},
{
type: 'text',
content: '正品MAC魅可口红礼盒生日唇膏小辣椒Chili西柚情人',
fontSize: 16,
lineHeight: 21,
color: '#383549',
textAlign: 'left',
top: 336,
left: 44,
width: 287,
MaxLineNumber: 2,
breakWord: true,
bolder: true
},
{
type: 'text',
content: '¥0.00',
fontSize: 19,
color: '#E62004',
textAlign: 'left',
top: 387,
left: 44.5,
bolder: true
},
{
type: 'text',
content: '原价:¥138.00',
fontSize: 13,
color: '#7E7E8B',
textAlign: 'left',
top: 391,
left: 110,
textDecoration: 'line-through'
},
{
type: 'text',
content: '长按识别图中二维码帮我砍个价呗~',
fontSize: 14,
color: '#383549',
textAlign: 'left',
top: 460,
left: 165.5,
lineHeight: 20,
MaxLineNumber: 2,
breakWord: true,
width: 125
}
]
}
})
},
eventSave () {
wx.saveImageToPhotosAlbum({
filePath: this.data.shareImage,
success (res) {
wx.showToast({
title: '保存图片成功',
icon: 'success',
duration: 2000
})
}
})
},
eventGetImage (event) {
console.log(event)
wx.hideLoading()
const { tempFilePath, errMsg } = event.detail
if (errMsg === 'canvasdrawer:ok') {
this.setData({
shareImage: tempFilePath
})
}
},
drawing(){
this.selectComponent('#drawing').showFrame();
this.eventDraw();
},
showFrame() {
this.setData({ flag: true, wrapAnimate: 'wrapAnimate', frameAnimate: 'frameAnimate' });
},
hideFrame() {
const that= this;
that.setData({ wrapAnimate: 'wrapAnimateOut', frameAnimate: 'frameAnimateOut' });
setTimeout(()=>{
that.setData({ flag: false})
},400)
},
// 分享转发
onShareAppMessage: function (res) {
if (res.from === 'button') {
}
return {
title: '转发',
path: '/pages/shop/shops/weidian/weidian_group_1/weidian_group_1.wxml',
success: function (res) {
console.log('成功', res)
}
}
},
catchNone(){
//阻止冒泡
},
_showEvent() {
this.triggerEvent("showEvent");
},
_hideEvent() {
this.triggerEvent("hideEvent");
}
}
})
{
"navigationBarTitleText": "",
"usingComponents": {
"canvasdrawer": "/components/canvasdrawer/canvasdrawer",
"drawing": "/components/drawing/drawing"
}
}
\ No newline at end of file
<view wx:if='{{flag}}'>
<view class='wrap {{wrapAnimate}}' style='background:rgba(0,0,0,{{bgOpacity}});'></view>
<view catchtap='hideFrame' class='frame-wrapper {{frameAnimate}}'>
<view catchtap='catchNone' class='frame_1'>
<!-- 标题 -->
<view class='title-wrapper tect'>
<view class="btexts">分享到</view>
</view>
<!-- 组件 -->
<!-- 内容 -->
<drawing id="drawing" frameTitle="这是标题" />
<view class="parallel">
<view class="avatar">
<button class="but" open-type="share"></button>
<image src="{{clientImgPath}}/2020/index/group_img/wx.png"></image>
<text class="">微信好友</text>
</view>
<view class="avatar">
<canvasdrawer painting="{{painting}}" class="canvasdrawer" bind:getImage="eventGetImage"/>
<button class="but" bindtap="drawing"></button>
<image src="{{clientImgPath}}/2020/index/group_img/wx.png"></image>
<text class="" >微信好友</text>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
/* components/ShareGroup/share.wxss */
.wrapAnimate {
animation: wrapAnimate 0.5s ease-in-out forwards
}
@keyframes wrapAnimate {
0% {}
100% {
background: rgba(0, 0, 0, 0.35);
}
}
.wrapAnimateOut {
animation: wrapAnimateOut 0.4s ease-in-out forwards
}
@keyframes wrapAnimateOut {
0% {
background: rgba(0, 0, 0, 0.35);
}
100% {
background: rgba(0, 0, 0, 0);
}
}
.frameAnimate {
animation: frameAnimate 0.5s ease forwards;
}
@keyframes frameAnimate {
0% {}
100% {
opacity: 1;
top: 0vh;
}
}
.frameAnimateOut {
animation: frameAnimateOut 0.4s ease forwards;
}
@keyframes frameAnimateOut {
0% {
opacity: 1;
top: 0vh;
}
100% {
opacity: 0;
top: 100vh;
}
}
.frame-wrapper {
position: fixed;
height: 100vh;
width: 100vw;
z-index: 999;
top: 50vh;
}
.frame_1 {
background: #fff;
position: fixed;
width: 100%;
left: 0;
bottom: 0;
height:300rpx;
}
.title-wrapper {
justify-content: space-between;
font-size: 4.9vw;
color: #4a4a4a;
/* margin-bottom: 5.9vw; */
}
.title-wrapper>image {
width: 3.2vw;
height: 3.2vw;
padding: 0 5vw;
margin-right: -5vw;
}
.flex {
display: flex;
align-items: center;
}
.wrap {
position: fixed;
z-index: 1;
top: 0;
left: 0;
right: 0;
bottom: 0;
}
.tect {
text-align: center;
}
.btexts {
font-size: 36rpx;
font-weight: 800;
color: rgba(26, 26, 26, 1);
padding: 24rpx
}
.avatar {
width: 130rpx;
height: 130rpx;
margin: 0 auto;
}
.wx {
margin-left: 10rpx;
}
.btxia {
font-size: 24rpx;
font-weight: 500;
color: rgba(128, 128, 128, 1);
}
.kuai {
max-height: 550rpx;
overflow-x: hidden;
}
.but {
width: 130rpx;
height: 130rpx;
position: absolute;
}
.botton {
width: 100%;
height: 88rpx;
/* background:rgba(255,105,0,1); */
border-radius: 10rpx;
font-size: 40rpx;
font-weight: 800;
color: rgba(255, 255, 255, 1);
line-height: 88rpx;
position: relative;
text-align: center;
color: black;
}
.botton {
width: 10%;
height: 50%;
margin-left: 210rpx;
color: black;
}
.parallel{
display: flex;
}
.share-image {
width: 600rpx;
height: 888rpx;
margin: 0 75rpx;
border: 1px solid black;
}
// components/Stars/Stars.js
const app = getApp();
var clientImgPath = app.globalData.clientImgPath;
Component({
/**
* 组件的属性列表
*/
properties: {
fen:{//fenshu
type:String,
value: ''
}
},
/**
* 组件的初始数据
*/
data: {
clientImgPath: clientImgPath
},
ready (){
//console.info("feb",this.data.fen);
//parseFloat(this.data.fen);
this.setData({
fen: parseFloat(this.data.fen)
});
//console.log(this.data.fen);
},
/**
* 组件的方法列表
*/
methods: {
fun(){
//console.log(this.data.fen);
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--components/Stars/Stars.wxml-->
<!-- <text>components/Stars/Stars.wxml</text>
-->
<!-- <view>{{fen}}</view> -->
<view class="star" wx:if="{{fen>=0 && fen<0.5}}">
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
</view>
<!-- 0.5 -->
<view class="star" wx:elif="{{fen>=0.5 && fen<1}}">
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/banxing.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
</view>
<!-- 1 -->
<view class="star" wx:elif="{{fen>=1 && fen<1.5}}">
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
</view>
<!-- 1.5 -->
<view class="star" wx:elif="{{fen>=1.5 && fen<2}}">
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/banxing.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
</view>
<!-- 2 -->
<view class="star" wx:elif="{{fen>=2 && fen<2.5}}">
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
</view>
<!-- 2.5 -->
<view class="star" wx:elif="{{fen>=2.5 && fen<3}}">
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/banxing.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
</view>
<!-- 3 -->
<view class="star" wx:elif="{{fen>=3 && fen<3.5}}">
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
</view>
<!-- 3.5 -->
<view class="star" wx:elif="{{fen>=3.5 && fen<4}}">
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/banxing.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
</view>
<!-- 4 -->
<view class="star" wx:elif="{{fen>=4 && fen<4.5}}">
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingweixuanzhong@2x.png"></image>
</block>
</view>
<!-- 4.5 -->
<view class="star" wx:elif="{{fen>=4.5 && fen<5}}">
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/banxing.png"></image>
</block>
</view>
<!-- 5 -->
<view class="star" wx:elif="{{fen>=5}}">
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
</view>
<!-- <view class="star" wx:elif="{{fen>'5'}}">
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
<block >
<image class="xingxing_min mr-5" src="{{clientImgPath}}/images/wm/xingxuanzhong@2x.png"></image>
</block>
</view> -->
/* components/Stars/Stars.wxss */
.star{
display: flex;
}
.xingxing{
width:28rpx;
height:28rpx;
display: inline-block;
margin-right: 15rpx;
}
.xingxing_min{
width:23rpx;
height:23rpx;
display: inline-block;
}
\ No newline at end of file
const app = getApp();
var clientImgPath = app.globalData.clientImgPath;
import {sendSms} from "../../api/basicInformation.js";
Component({
/**
* 组件的属性列表
*/
properties: {
//手机号码
phone: {
type: String,
default: "",
},
//操作类型
type: {
type: String,
default: "1",//默认
}
// 1:提现验证
},
/**
* 组件的初始数据
*/
data: {
// 隐藏
hideModal: true, //模态框的状态 true-隐藏 false-显示
clientImgPath: clientImgPath,
issettle: true,//是否设置手机号码 设置 true 没有设置false
//phone:"",//手机号码
code:"",//验证码
datesis:60,//倒计时
},
/**
* 组件的方法列表
*/
methods: {
// 显示遮罩层
showModal: function () {
/* 这里需要一个接口来检测用户是否设置了手机号码 */
/* 如果没有设置手机号码 应该提示用户让用户去设置手机号码 */
/* 。。。。。。 */
var that = this;
if(that.data.phone==""){
that.setData({
issettle:false,
});
}
that.setData({
hideModal: false,
isFolded: false,
})
var animation = wx.createAnimation({
duration: 0,//动画的持续时间 默认400ms 数值越大,动画越慢 数值越小,动画越快
timingFunction: 'ease',//动画的效果 默认值是linear
})
this.animation = animation
setTimeout(function () {
that.fadeIn();//调用显示动画
}, 0)
},
// 隐藏遮罩层
hideModal: function () {
var that = this;
setTimeout(function () {
that.setData({
hideModal: true,
isFolded: true,
})
}, 0)//先执行下滑动画,再隐藏模块
//触发父组件的提交事件
},
//确定按点击后
confirm() {
if (!(/^1[3456789]\d{9}$/.test(this.data.phone))) {
wx.showToast({
title: '手机号码有误',
icon: 'none',
})
} else if(this.data.code==""){
wx.showToast({
title: '验证码不能为空',
icon: 'none',
})
}else{
//this.hideModal();//隐藏
this.triggerEvent("formsubmit", { code: this.data.code, phone: this.data.phone, type:this.data.type });//提交表单
this.setData({
code:''
});
}
/***
*
*
*
*/
},
//动画集
fadeIn: function () {
this.animation.translateY(0).step()
this.setData({
animationData: this.animation.export()//动画实例的export方法导出动画数据传递给组件的animation属性
})
},
fadeDown: function () {
this.animation.translateY(300).step()
this.setData({
animationData: this.animation.export(),
})
},
//双向绑定手机号码
changeinpinttel(e){
this.setData({
phone: e.detail.value,
})
},
//双向绑定验证码
changeinpintcode(e) {
this.setData({
code: e.detail.value,
})
},
//去设置手机号码
tosetel(){
wx.navigateTo({
url: '/pages/personal/set/set',
})
},
//发送验证码按钮点击后
shendcodefun(){
console.info("124");
if (!(/^1[3456789]\d{9}$/.test(this.data.phone))) {
wx.showToast({
title: '手机号码有误',
icon: 'none',
})
} else {
//。。。 请求发送验证码的接口
sendSms({
mobile: this.data.phone,
smstype:this.data.type,
}).then((res)=>{
if(res.code==0){
wx.showToast({
title: res.msg,
icon: 'none',
})
//倒计时代码
let timeid = setInterval(() => {
this.setData({
datesis: this.data.datesis - 1,
})
if (this.data.datesis <= 0) {
clearInterval(timeid);
this.setData({
datesis: 60,
})
}
}, 1000)
}else{
wx.showToast({
title: res.msg,
icon: 'none',
})
}
}).catch((e)=>{
console.info(e);
wx.showToast({
title: e,
icon: 'none',
})
})
}
}
}
})
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file
<!-- 验证身份组件 弹出串口后 用户输入手机号码发送验证码验证 -->
<view>
<view class="modals modals-bottom-dialog" hidden="{{hideModal}}">
<view class="modals-cancelss" bindtap="hideModal"></view>
<view class="id-dialog-bodys bottom-pos" animation="{{animationData}}">
<!-- 用户已经设置过了手机号码 -->
<view class="haed_bodys" wx:if="{{issettle==true}}">
<view class="msgs">为了你的账户安全,</view>
<view class="msgs">系统需要对你的身份进行验证</view>
<view class="fromboxs">
<view class="lablecell flex ali-c">
<view class="cellname">手机号码</view>
<view class="inputbox">
<input type="number" value="{{phone}}" bindinput="changeinpinttel" class="input" disabled="true" placeholder="请输入手机号码"></input>
</view>
</view>
<view class="lablecell flex ali-c">
<view class="cellname">验证码</view>
<view class="inputbox">
<input type="number" value="{{code}}" bindinput="changeinpintcode" class="input" placeholder="请输入验证码"></input>
<view class="codetag" wx:if="{{datesis==60}}" bindtap="shendcodefun">发送</view>
<view class="codetag codetagtwo" wx:if="{{datesis!=60}}" >{{datesis}}</view>
</view>
</view>
</view>
<view class="buttonbox">
<button class="butss" bindtap='confirm' >提交</button>
</view>
<!-- confirm -->
</view>
<view class="haed_bodys" wx:if="{{issettle==false}}">
<!-- 让用户去设置手机号码 -->
<view class="msgs">为了你的账户安全,</view>
<view class="msgs">你需要先绑定手机号码</view>
<view class="buttonbox">
<button class="butss" bindtap='tosetel' >去设置</button>
</view>
</view>
<image class="imgscole" bindtap="hideModal" src="{{clientImgPath}}/images/uts/guanbi.png"></image>
<!-- 关闭按钮 -->
</view>
</view>
</view>
\ No newline at end of file
@import"/utils/css/public.wxss";
/* 弹窗 */
.modals-cancelss{
position:relative ;
z-index:1000; top:0; left: 0; right:0; bottom: 0; background-color: rgba(0,0,0,.5);
width: 100vw;
height: 100vh;
}
.id-dialog-bodys{
position: absolute;
z-index: 9997;
/* bottom: 40%; */
bottom: 40%;
left: 0;
right: 0;
/*padding-top: 24rpx;*/
border-radius: 10rpx ;
background-color: #fff;
box-sizing: border-box;
width: 70%;
margin: 0 auto;
}
/*动画前初始位置*/
.bottom-pos{-webkit-transform:translateY(100%);transform:translateY(100%);}
.id_yh_btn{
width:100%;
height:88rpx;
border-top: 2rpx solid rgba(229,229,229,1);
font-size:32rpx;
font-weight:800;
color:#121212;
text-align: center;
}
button{
background: none;
border: none;
border-radius: 0rpx;
}
button::after{
background: none;
border: none;
border-radius: 0rpx;
}
.id_text_top{
padding: 30rpx;
box-sizing: border-box;
font-size:30rpx;
font-weight:500;
color:#5a5959b9;
text-indent:2em;
}
.headimg{
height: 300rpx;
width: 100%;
}
.haed_bodys{
padding-top: 20rpx;
}
.haed_bodys .msgs{
font-weight: bold;
color:#333C4C;
font-size: 32rpx;
text-align: center;
}
.haed_bodys .msgs .text{
color:#f64f15;
}
.fromboxs{
margin-top: 30rpx;
}
.lablecell{
height: 88rpx;
line-height: 88rpx;
font-size: 30rpx;
padding:0 24rpx ;
border-bottom: 1px solid #f5f5f5;
}
.cellname{
margin-right: 10rpx;
width: 140rpx;
}
.inputbox{
position: relative;
height: 88rpx;
}
.input{
height: 88rpx;
line-height: 88rpx;
}
.codetag{
position: absolute;
top: 14rpx;
right: 0;
z-index: 99;
color:#FFFFFF;
background: #f64f15;
font-size: 28rpx;
padding: 0 30rpx;
height: 60rpx;
line-height: 60rpx;
box-sizing: border-box;
border-radius: 4rpx;
}
.codetagtwo{
background: #999;
}
.butss{
font-size: 32rpx;
/* width:411rpx; */
height:83rpx;
line-height: 83rpx;
text-align: center;
background:rgba(255,105,0,1);
border-radius:10rpx;
color:#FFFFFF;
margin: 0 auto;
margin-top: 50rpx;
margin-bottom: 30rpx;
}
.buttonbox{
padding: 0 24rpx;
}
.imgscole{
position: absolute;
left: 50%;
margin-left: -30rpx;
margin-top: 40rpx;
width: 60rpx;
height: 60rpx;
}
\ No newline at end of file
// components/recommend/recommend.js
const app = getApp();
var img_host = app.globalData.ImgPath; //域名
var clientImgPath = app.globalData.clientImgPath;
Component({
/**
* 组件的属性列表
*/
properties: {
For: {
type: Array,
value: []
},
Fo: {
type: Array,
value: []
},
Fo: {
type: Array,
value: []
}
},
/**
* 组件的初始数据
*/
data: {
img_host: img_host, //请求域名
clientImgPath:clientImgPath,
// dataList:{
// type:Array,
// value:[]
// }
// h:[],
// j:[],
// c:[]
},
ready() { //组件中的周期函数
this.setData({
For: this.data.For, //接收页面传递过来的数据
});
console.log(this.data.For)
},
/**
* 组件的方法列表
*/
methods: {
//商品详情
jumpToDetail(e){
let goods_id = e.currentTarget.dataset.goods_id
let cate_id = this.data.curid ? this.data.curid : e.currentTarget.dataset.cate_id
console.log(goods_id,cate_id)
this.setData({
is_open: false
})
wx.navigateTo({
url: '/pages/shop/shops/weidian/weidian_details/weidian_details?goods_id=' + goods_id + '&cate_id=' + cate_id,
})
},
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<!--components/recommend/recommend.wxml-->
<view class="bgf w1005 brs" style="padding:0 20rpx 24rpx 20rpx;margin-top:-30rpx;box-sizing:border-box;" wx:if="{{For.length!=0}}">
<view wx:for="{{For}}" wx:key="index" bindtap="jumpToDetail" wx:if="{{index>5 && index<9}}" data-goods_id="{{item.goods_id}}" data-cate_id="{{item.cate_id}}" class="{{index==6?'ys':'yss'}}">
<image src="{{img_host}}/attachs/{{item.photo}}" style="width:240rpx;height:240rpx;" class="br10"></image>
<view class="flex1" style="padding:0 0 0 20rpx;">
<view class="fwb mb10 s30 oneline" style="height:80rpx;overflow: hidden;text-align: left" >{{item.title}}</view>
<!-- <view class="flex acen jus oneline ">
{{item.intro}}
</view> -->
<!-- <view class="flex acen jusb " >
<view class="flex acen" style="maigin:0">
{{item.intro}}
<view class="s26 information">
<text class="lmzy">鹿马自营</text>
<text class="lmzys">精美礼品</text>
</view>
</view>
<view class="s20 cf" style="padding:2rpx 4rpx;background:#f64f15;border-radius:5rpx;">鹿马配送</view>
</view> -->
<view class="tb" >已有{{item.sold_num}}人购买</view>
<view class="monetary">
<view >
<view class="commodity_price">
<text class="price_1">助农价¥</text>
<text class="price_2">{{item.f_price}}<text style="font-weight: bold;font-size: 26rpx;">元/{{item.guige}}</text></text>
<!-- <text class="price_1" style="text-decoration:line-through;color:gray;font-size:18rpx;"> 原价{{item.market_price}}元/{{item.guige}}</text> -->
</view>
<!-- <view class="commodity_price_1">
<text class="price_1">¥</text>
<text class="price_3">{{item.price}}</text>
</view> -->
</view>
<view style="margin: 20rpx 0 0 0;">
<text class="purchase">立即购买</text>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
/* components/recommend/recommend.wxss */
@import "/style/out.wxss";
.label {
color: #f64f15;
padding: 2rpx 6rpx;
border: 1px solid #f64f15;
margin: 10rpx 26rpx 0 0;
border-radius: 5rpx;
}
.ml-10 {
margin-left: 10rpx;
}
.chain {
position: absolute;
display: inline-block;
}
.evaluate {
display: flex;
}
.evaluate_2 {
color: #F64F15;
font-size: 28rpx;
padding: 0 0 0 4rpx;
margin-top: -4rpx;
}
.num {
color: #6B6B6B;
margin-right: 50rpx;
margin-top: -6rpx;
display: flex;
justify-content: right;
}
.information {
font-size: 24rpx;
color: #333333;
font-weight: 500;
width: 300rpx;
display: flex;
}
.yue {
width: 100rpx;
}
.wai {
padding: 4rpx 10rpx;
color: white;
background-color: tomato;
border-radius: 6rpx;
margin: 0 6rpx;
font-size: 20rpx;
}
.dian {
padding: 4rpx 10rpx;
color: white;
background-color: rgb(23, 139, 235);
border-radius: 6rpx;
margin: 0 6rpx;
font-size: 20rpx;
}
/* 礼品精选 */
.lmzy{
width: 56px;
padding: 6rpx 10rpx 6rpx;
border-radius: 6rpx;
border: 2rpx solid red;
color: red;
text-align: center;
}
.lmzys{
width: 56px;
padding: 4rpx 10rpx 4rpx;
border-radius: 10rpx;
border: 2rpx solid red;
margin: 0 0 0 10rpx;
color: red;
text-align: center;
}
.distance {
width: 84rpx;
}
.monetary{
/* display: flex;
justify-content: space-between;
position: absolute; */
bottom: 0;
/* margin-top: 80rpx; */
}
.zy{
margin: 10rpx 0 16rpx 0;
}
/*文字两行溢出*/
.twoline{
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.monetary_2{
margin: 0 80rpx 0 20rpx;
}
.commodity_price {
/* width: 220rpx; */
height: 40rpx;
color: #FA4545;
font-size: 26rpx;
/* text-align: center; */
line-height: 50rpx;
}
.commodity_price_1{
width: 220rpx;
height: 40rpx;
color: #969696;
text-decoration:line-through;
font-size: 22rpx;
text-align: center;
line-height: 50rpx;
margin: 0 0 0 10rpx;
}
.ys{
padding: 5px;
border: 2px solid #f46f15;
border-right: 4rpx solid #f46f15;
border-bottom-left-radius: 12rpx;
border-bottom-right-radius: 12rpx;
/* border-radius: 10rpx; */
border-bottom: 4rpx solid #f46f15;
border-left: 4rpx solid #f64f15;
margin-top: 30rpx;
display: flex;
}
.yss{
border-bottom-left-radius: 10rpx;
border-bottom-right-radius: 10rpx;
border-radius: 10rpx;
padding: 10rpx;
border:4rpx solid #f46f15;
display: flex;
margin-top: 30rpx;
}
.tb{
/* font-size: 24px; */
font-weight: 500;
color: rgba(255,115,79,1);
line-height: 46rpx;
width: 150px;
height: 46rpx;
background: rgba(255,233,204,1);
border-radius: 10px;
text-align: center;
margin: 10rpx 0 10rpx 0;
font-size: 22rpx;
position: relative;
}
.price_1 {
font-size: 20rpx;
font-weight: 500;
}
.price_2 {
font-weight: bold;
font-size: 34rpx;
}
.price_3 {
font-weight: bold;
font-size: 26rpx;
}
.purchase{
padding: 4rpx 16rpx 4rpx;
border-radius:10rpx;
background: linear-gradient(90deg, rgba(243, 0, 9, 1) 0%,rgba(255, 113, 64, 1) 99%);
font-size: 24rpx;
color: #ffffff;
}
/*文字一行溢出*/
.oneline{
/* display: -webkit-box; */
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
}
.brs{
border-bottom-right-radius: 20rpx;
border-bottom-left-radius: 20rpx;
}
\ No newline at end of file
/* global Component wx */
Component({
properties: {
painting: {
type: Object,
value: {view: []},
observer (newVal, oldVal) {
if (!this.data.isPainting) {
if (JSON.stringify(newVal) !== JSON.stringify(oldVal)) {
if (newVal && newVal.width && newVal.height) {
this.setData({
showCanvas: true,
isPainting: true
})
this.readyPigment()
}
} else {
if (newVal && newVal.mode !== 'same') {
this.triggerEvent('getImage', {errMsg: 'canvasdrawer:samme params'})
}
}
}
}
}
},
data: {
showCanvas: false,
width: 100,
height: 100,
tempFileList: [],
isPainting: false
},
ctx: null,
cache: {},
ready () {
wx.removeStorageSync('canvasdrawer_pic_cache')
this.cache = wx.getStorageSync('canvasdrawer_pic_cache') || {}
this.ctx = wx.createCanvasContext('canvasdrawer', this)
},
methods: {
readyPigment () {
const { width, height, views } = this.data.painting
this.setData({
width,
height
})
const inter = setInterval(() => {
if (this.ctx) {
clearInterval(inter)
this.ctx.clearActions()
this.ctx.save()
this.getImagesInfo(views)
}
}, 100)
},
getImagesInfo (views) {
const imageList = []
for (let i = 0; i < views.length; i++) {
if (views[i].type === 'image') {
imageList.push(this.getImageInfo(views[i].url))
}
}
const loadTask = []
for (let i = 0; i < Math.ceil(imageList.length / 8); i++) {
loadTask.push(new Promise((resolve, reject) => {
Promise.all(imageList.splice(i * 8, 8)).then(res => {
resolve(res)
}).catch(res => {
reject(res)
})
}))
}
Promise.all(loadTask).then(res => {
let tempFileList = []
for (let i = 0; i < res.length; i++) {
tempFileList = tempFileList.concat(res[i])
}
this.setData({
tempFileList
})
this.startPainting()
})
},
startPainting () {
const { tempFileList, painting: { views } } = this.data
console.log(tempFileList)
for (let i = 0, imageIndex = 0; i < views.length; i++) {
if (views[i].type === 'image') {
this.drawImage({
...views[i],
url: tempFileList[imageIndex]
})
imageIndex++
} else if (views[i].type === 'text') {
if (!this.ctx.measureText) {
wx.showModal({
title: '提示',
content: '当前微信版本过低,无法使用 measureText 功能,请升级到最新微信版本后重试。'
})
this.triggerEvent('getImage', {errMsg: 'canvasdrawer:version too low'})
return
} else {
this.drawText(views[i])
}
} else if (views[i].type === 'rect') {
this.drawRect(views[i])
}
}
this.ctx.draw(false, () => {
wx.setStorageSync('canvasdrawer_pic_cache', this.cache)
const system = wx.getSystemInfoSync().system
if (/ios/i.test(system)) {
this.saveImageToLocal()
} else {
// 延迟保存图片,解决安卓生成图片错位bug。
setTimeout(() => {
this.saveImageToLocal()
}, 800)
}
})
},
drawImage (params) {
this.ctx.save()
const { url, top = 0, left = 0, width = 0, height = 0, borderRadius = 0, deg = 0 } = params
// if (borderRadius) {
// this.ctx.beginPath()
// this.ctx.arc(left + borderRadius, top + borderRadius, borderRadius, 0, 2 * Math.PI)
// this.ctx.clip()
// this.ctx.drawImage(url, left, top, width, height)
// } else {
if (deg !== 0) {
this.ctx.translate(left + width/2, top + height/2)
this.ctx.rotate(deg * Math.PI / 180)
this.ctx.drawImage(url, -width/2, -height/2, width, height)
} else {
this.ctx.drawImage(url, left, top, width, height)
}
// }
this.ctx.restore()
},
drawText (params) {
this.ctx.save()
const {
MaxLineNumber = 2,
breakWord = false,
color = 'black',
content = '',
fontSize = 16,
top = 0,
left = 0,
lineHeight = 20,
textAlign = 'left',
width,
bolder = false,
textDecoration = 'none'
} = params
this.ctx.beginPath()
this.ctx.setTextBaseline('top')
this.ctx.setTextAlign(textAlign)
this.ctx.setFillStyle(color)
this.ctx.setFontSize(fontSize)
if (!breakWord) {
this.ctx.fillText(content, left, top)
this.drawTextLine(left, top, textDecoration, color, fontSize, content)
} else {
let fillText = ''
let fillTop = top
let lineNum = 1
for (let i = 0; i < content.length; i++) {
fillText += [content[i]]
if (this.ctx.measureText(fillText).width > width) {
if (lineNum === MaxLineNumber) {
if (i !== content.length) {
fillText = fillText.substring(0, fillText.length - 1) + '...'
this.ctx.fillText(fillText, left, fillTop)
this.drawTextLine(left, fillTop, textDecoration, color, fontSize, fillText)
fillText = ''
break
}
}
this.ctx.fillText(fillText, left, fillTop)
this.drawTextLine(left, fillTop, textDecoration, color, fontSize, fillText)
fillText = ''
fillTop += lineHeight
lineNum ++
}
}
this.ctx.fillText(fillText, left, fillTop)
this.drawTextLine(left, fillTop, textDecoration, color, fontSize, fillText)
}
this.ctx.restore()
if (bolder) {
this.drawText({
...params,
left: left + 0.3,
top: top + 0.3,
bolder: false,
textDecoration: 'none'
})
}
},
drawTextLine (left, top, textDecoration, color, fontSize, content) {
if (textDecoration === 'underline') {
this.drawRect({
background: color,
top: top + fontSize * 1.2,
left: left - 1,
width: this.ctx.measureText(content).width + 3,
height: 1
})
} else if (textDecoration === 'line-through') {
this.drawRect({
background: color,
top: top + fontSize * 0.6,
left: left - 1,
width: this.ctx.measureText(content).width + 3,
height: 1
})
}
},
drawRect (params) {
this.ctx.save()
const { background, top = 0, left = 0, width = 0, height = 0 } = params
this.ctx.setFillStyle(background)
this.ctx.fillRect(left, top, width, height)
this.ctx.restore()
},
getImageInfo (url) {
return new Promise((resolve, reject) => {
if (this.cache[url]) {
resolve(this.cache[url])
} else {
const objExp = new RegExp(/^http(s)?:\/\/([\w-]+\.)+[\w-]+(\/[\w- .\/?%&=]*)?/)
if (objExp.test(url)) {
wx.getImageInfo({
src: url,
complete: res => {
if (res.errMsg === 'getImageInfo:ok') {
this.cache[url] = res.path
resolve(res.path)
} else {
this.triggerEvent('getImage', {errMsg: 'canvasdrawer:download fail'})
reject(new Error('getImageInfo fail'))
}
}
})
} else {
this.cache[url] = url
resolve(url)
}
}
})
},
saveImageToLocal () {
const { width, height } = this.data
wx.canvasToTempFilePath({
x: 0,
y: 0,
width,
height,
canvasId: 'canvasdrawer',
complete: res => {
if (res.errMsg === 'canvasToTempFilePath:ok') {
this.setData({
showCanvas: false,
isPainting: false,
tempFileList: []
})
this.triggerEvent('getImage', {tempFilePath: res.tempFilePath, errMsg: 'canvasdrawer:ok'})
} else {
this.triggerEvent('getImage', {errMsg: 'canvasdrawer:fail'})
}
}
}, this)
}
}
})
{
"component": true
}
\ No newline at end of file
<canvas canvas-id="canvasdrawer" style="width:{{width}}px;height:{{height}}px;" class="board" wx:if="{{showCanvas}}"></canvas>
\ No newline at end of file
.board {
position: fixed;
top: 2000rpx;
}
\ No newline at end of file
// components/comment-top/comment-top.js
const app = getApp();
let staticUrl = app.globalData.staticUrl;
import Util from '../../utils/util.js';
import {editFollow} from '../../api/community'
Component({
options: {
multipleSlots: true // 在组件定义时的选项中启用多slot支持
},
/**
* 组件的属性列表
*/
properties: {
isshowUid:{
type:String,
value:''
},
dataType:{
type:String,
value:''
},
dataTypes:{
type:String,
value:''
},
popclass:{
type:String,
value:''
},
FollowList:{
type:Object,
value:{}
}
},
/**
* 组件的初始数据
*/
data: {
// time:Util.formatTime(new Date())
// isshowUid:''
staticUrl,
},
/**
* 组件的方法列表
*/
methods: {
// create_time: "2020-10-16 20:48:40"
// face: "https://thirdwx.qlogo.cn/mmopen/vi_32/maGUG7I6mxKV3iby9lz91C2N5ev0sCyKFqe0EYj0tK8fjcqQHTBDODCDKPR8gwNCFXWalkm4iax7zKpXeuFbWbXw/132"
// follow_uid: 813883
// nickname: "活出自己色彩"
jumpPersonal(e) {
console.log(e)
// console.log(this.properties.userid)
// console.log(e.currentTarget.dataset.uid)
let user_id = e.currentTarget.dataset.uid
let is_follow = e.currentTarget.dataset.isfollow
let userid = 'asd'
console.log(user_id)
wx.navigateTo({
url: '/pages/community/showcomment/showcomment?user_id=' + user_id + '&userid='+userid + '&isfollow=' + is_follow,
})
},
//取消关注
clickchange(e) {
console.log(e)
editFollow({
status: 2,
follow_uid: e.currentTarget.dataset.uid
}).then(res => {
if(res.code == 0){
wx.showToast({
title: '取关成功',
})
this.setData({
isshowUid:e.currentTarget.dataset.uid
})
// wx.switchTab({
// url: '/pages/community/community',
// success: (res) => {
// let page = getCurrentPages().pop();
// if (page == undefined || page == null) return;
// page.onShow();
// },
// fail: (res) => {
// }
// })
}
})
},
}
})
{
"component": true,
"usingComponents": {
}
}
\ No newline at end of file
<!--components/comment-top/comment-top.wxml-->
<!-- top -->
<view>
<view class="fx {{dataType==2||dataTypes==2||popclass==2?'guanzhu':''}}" style="justify-content: space-between;background-color: #fff;" hidden="{{FollowList.follow_uid == isshowUid}}">
<view class="fx">
<view style="height: 80rpx;width: 80rpx;border-radius: 80rpx;text-align: center;line-height: 80rpx;overflow:hidden;" data-isfollow="{{1}}" data-uid="{{FollowList.follow_uid}}" bindtap="jumpPersonal">
<image src="{{FollowList.face}}"></image>
</view>
<view style="margin:0 0 0 10rpx;">
<view class="onelines" style="font: 34rpx 微软雅黑;" >{{FollowList.nickname}}</view>
<view style="font-size:20rpx;color:rgb(116, 113, 113);">{{FollowList.create_time}}</view>
</view>
</view>
<view hidden="{{dataTypes==2}}" style="line-height: 80rpx;" data-uid="{{FollowList.follow_uid}}" bindtap="clickchange">
<text style="border: 2rpx solid #DC143C;color:#DC143C;padding: 0 12rpx;border-radius: 10rpx;">已关注</text>
</view>
<view hidden="{{dataType==2}}" style="line-height: 80rpx;" data-uid="{{FollowList.follow_uid}}" bindtap="clickchange">
<image style="width:80rpx" src="{{staticUrl}}2020/11/03/5fa0d0a2a704f.jpg"></image>
</view>
<!-- 关注插槽 -->
<!-- <view style="line-height: 80rpx;" bindtap="clickchange">
<text style="border: 2rpx solid #DC143C;color:#DC143C;padding: 0 12rpx;border-radius: 10rpx;margin: 0 5px 0 0;">
已关注
</text>
</view> -->
</view>
<!-- <slot name="content"></slot> -->
</view>
\ No newline at end of file
/* components/comment-top/comment-top.wxss */
.fx {
display: flex;
flex: 1;
}
.guanzhu {
padding: 24rpx;
margin: 1px 0 0 0;
}
.pd24{
padding:24rpx
}
/*文字一行溢出*/
.onelines{
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
flex:1
}
const app = getApp();
var clientImgPath = app.globalData.clientImgPath;
var img_host = app.globalData.ImgPath;
let staticUrl = app.globalData.staticUrl;
import {
editFollow,
delCommunity,
editLike,
getCommentList
} from '../../api/community'
Component({
// 启用插槽
options: {
multipleSlots: true
},
// pageLifetimes: {
// show: function() {
// console.log(this.properties.communityLists)
// // 页面被展示
// this.setData({
// communityListss:this.properties.communityLists
// })
// },
// },
// ready(e){
// console.log(this.properties.communityLists)
// this.setData({
// communityListss:this.properties.communityLists
// })
// },
/**
* 组件的属性列表
*/
properties: {
communityLists: {
type: Object,
default: {}
},
isguanzhu:{
type:Number,
default:0
},
userid: {
type: Number,
default: 0,
// observer:function(recordlist){
// console.log('recordlist',recordlist)
// }
}
},
/**
* 组件的初始数据
*/
data: {
// communityListss:{},
popshow: true,
followtype: '关注',
islove: true,
commentList:[],
countNum:'',
isshow:'',
// userid:getApp().globalData.userInfo.user_id
// userid:this.properties.communityLists.isfollow
staticUrl,
img_host,
clientImgPath,
},
/**
* 组件的方法列表
*/
methods: {
// 评论弹窗
popcomment(e) {
console.log(e)
this.data.popshow = false;
getCommentList({
page:1,
community_id:e.currentTarget.dataset.communityid
}).then(res=>{
if(res.code==0){
this.setData({
commentList:res.data.list
})
this.setData({
countNum:res.data.count
})
this.triggerEvent('commentList',this.data.commentList);
this.triggerEvent('countNum',this.data.countNum)
this.triggerEvent('communityid',e.currentTarget.dataset.communityid)
console.log(this.data.commentList)
}
})
console.log(this.data.popshow)
this.triggerEvent('show', this.data.popshow);
// this.triggerEvent('',)
},
// 点击关注
clickchange(e) {
console.log(e)
this.triggerEvent('isshow',e.currentTarget.dataset.uid)
if (e.currentTarget.dataset.isfollow == 0) {
editFollow({
status: 1,
follow_uid: this.properties.communityLists.uid
}).then(res => {
if (res.code == 0) {
wx.showToast({
title: '关注成功',
})
// this.properties.communityLists.isfollow = 1
// console.log(this.properties.communityLists)
// wx.navigateto({
// url: '/pages/community/community',
// success: (res) => {
// let page = getCurrentPages().pop();
// if (page == undefined || page == null) return;
// // page.onShow();
// },
// fail: (res) => {
// }
// })
// console.log(11111)
}
})
} else if (e.currentTarget.dataset.isfollow == 1) {
this.setData({
iscode:false
})
editFollow({
status: 2,
follow_uid: this.properties.communityLists.uid
}).then(res => {
if(res.code == 0){
wx.showToast({
title: '取关成功',
})
this.properties.communityLists.isfollow = 0;
console.log(this.properties.communityLists)
wx.navigateto({
url: '/pages/community/community',
success: (res) => {
// let page = getCurrentPages().pop();
// if (page == undefined || page == null) return;
// page.onShow();
},
fail: (res) => {
}
})
}
})
} else {
}
},
// 删除发表的文章
delMessage(e) {
let that = this
wx.showModal({
title: '提示',
content: '确定要删除这条圈子',
showCancel: true, //是否显示取消按钮
cancelText: "", //默认是“取消”
cancelColor: 'skyblue', //取消文字的颜色
confirmText: "", //默认是“确定”
confirmColor: 'skyblue', //确定文字的颜色
success: function (res) {
if (res.cancel) {
//点击取消,默认隐藏弹框
} else {
//点击确定
delCommunity({
community_id: e.currentTarget.dataset.communityid
}).then(res => {
if (res.code == 0) {
wx.showToast({
title: '删除成功',
})
that.triggerEvent('delOwnCommunity',e.currentTarget.dataset.communityid)
}
})
}
},
})
},
// 跳转个人文章主页
jumpPersonal(e) {
console.log(e)
console.log(this.properties.userid)
console.log(e.currentTarget.dataset.uid)
let user_id = e.currentTarget.dataset.uid
let is_follow = e.currentTarget.dataset.isfollow
console.log(user_id)
wx.navigateTo({
url: '/pages/community/showcomment/showcomment?user_id=' + user_id + '&userid='+this.properties.userid + '&isfollow=' + is_follow,
})
},
//跳转giftDetail
giftDetail(e) {
console.log(e);
let goods_id = e.currentTarget.dataset.goods_id
// console.log(goods_id,cate_id)
wx.navigateTo({
url: '/pages/shop/shops/weidian/weidian_details/weidian_details?goods_id=' + goods_id + "&fxuser_id=" + this.properties.communityLists.fxuser_id,
})
},
preImage(e) {
console.log(e)
let index = e.currentTarget.dataset.index;
var imgArr = this.properties.communityLists.pics.map((value, index) => {
return this.data.staticUrl + value
});
let url = imgArr[index]
wx.previewImage({
current: url,
urls: imgArr,
})
},
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {
"comment-top":"/components/comment-top/comment-top"
}
}
\ No newline at end of file
<!-- 评论内容 -->
<view class="content_box">
<!-- top -->
<view>
<view class="fx {{dataType==2||popclass==2?'guanzhu':''}} {{communityLists.uid == userid?'':'sbetween'}}" style="background-color: #fff;align-items: center;">
<view class="fx" style="flex:1;">
<view class="topImage" data-isfollow="{{communityLists.isfollow}}" data-uid="{{communityLists.uid}}" catchtap="jumpPersonal">
<image src="{{communityLists.face}}"></image>
</view>
<view style="margin:0 0 0 10rpx;">
<!-- color:#f64f15;text-shadow:1rpx 1rpx 0px #f64f15; -->
<view style="font: 34rpx ;height:44rpx;color:#F64F15" class="onelines">{{communityLists.nickname}}</view>
<view style="font-size:20rpx;color:rgb(116, 113, 113);display:flex;align-item:center;">
<view style="font-size:24rpx;">{{communityLists.create_time}}</view>
<view wx:if="{{communityLists.uid == userid}}" data-communityId="{{communityLists.community_id}}" style="font-size: 24rpx;color:#f64f15;margin: 0 0 0 20rpx;" catchtap="delMessage" >
删除
</view>
</view>
</view>
</view>
<!-- <view style="line-height: 80rpx;"><text style="border: 2rpx solid #DC143C;color:#DC143C;padding: 0 12rpx;border-radius: 10rpx;">关注</text></view> -->
<!-- 关注插槽 {{communityLists.isfollow==0?'关注':'已关注'}} -->
<view >
<!-- communityLists.isfollow -->
<view wx:if="{{communityLists.uid != userid}}" data-uid="{{communityLists.uid}}" data-isfollow="{{iscode?1:0}}" catchtap="clickchange">
<view wx:if="{{communityLists.isfollow==0}}" hidden="{{communityLists.uid == isguanzhu}}" style="border: 2rpx solid #DC143C;color:#DC143C;padding: 0 12rpx;border-radius: 10rpx;font-size: 28rpx;" >
关注
</view>
</view>
</view>
</view>
</view>
<!-- center -->
<view wx:if="{{communityLists.share_title!=''&&communityLists.share_title!=0}}" style="font:30rpx 微软雅黑;text-align: justify;margin:15rpx 0;word-break: break-all;">
{{communityLists.share_title}}
<!-- --{{userid}}--{{communityLists.uid}}f64f15 -->
</view>
<!-- images -->
<!-- center -->
<view style="font:28rpx 微软雅黑;padding:10rpx 0 0 10rpx;text-align: justify;word-break: break-all;" class="{{communityLists.share_title==0?'':'bjyans'}}">
{{communityLists.content}}
<!-- --{{userid}}--{{communityLists.uid}}f64f15 -->
</view>
<!-- images -->
<view class="fx top_image {{communityLists.share_title==0?'':'bjyans'}}" >
<view class="top_image_item" wx:key="index" wx:for="{{communityLists.pics}}">
<image mode="aspectFill" style="border-radius: 4rpx" src="{{staticUrl}}{{communityLists.pics[index]}}" data-index="{{index}}" catchtap="preImage"></image>
</view>
</view>
<!-- bottom -->
<slot name="bottom"> </slot>
<view wx:if="{{communityLists.goods_id!=0}}" class="giftDetail" catchtap="giftDetail" data-goods_id="{{communityLists.goods_id}}" data-cate_id="{{4}}">
<view style="width:30rpx;height:30rpx;padding: 4rpx 8rpx 4rpx 4rpx; display: inline-block;">
<image src="{{clientImgPath}}/images/slices/gift.png"> </image>
</view>
<view style="color:#FF0000;font-size: 22rpx;display: flex;"> 我已分享【<text class="oneline">{{communityLists.goods_title}}</text>】¥{{communityLists.price}} </view>
</view>
<!-- 点赞 -->
<slot name="fabulous"> </slot>
</view>
\ No newline at end of file
/* components/comment/comment.wxss */
.content_box{
background-color:#fff;
margin: 0rpx 0 10rpx 0;
padding: 24rpx;
}
.fx{
display: flex;
}
.top_image{
flex-wrap: wrap;
/* justify-content: space-between; */
}
.top_image_item{
height: 217rpx;
width: 217rpx;
margin: 10rpx 7rpx 10rpx 10rpx
}
.bottom_box{
margin:20rpx 0 10rpx 0 ;
/* justify-content:space-between */
}
.bottom_image{
margin: 0 0 0 -10px;
height: 40rpx;
width: 40rpx;
border-radius: 80rpx;
text-align: center;
line-height: 80rpx;
}
.bottom_image_frist{
height: 40rpx;
width: 40rpx;
border-radius: 40rpx;
text-align: center;
overflow: hidden;
line-height: 80rpx;
}
.giftDetail{
display:flex;
background-color:#FFC0CB;
width:70%;
justify-content: center;
border-radius: 30rpx;
line-height:40rpx;
height:40rpx;
}
.sbetween{
justify-content: space-between;
}
.topImage{
height: 80rpx;
width: 80rpx;
border-radius: 80rpx;
text-align: center;
line-height: 80rpx;
overflow: hidden;
}
.oneline{
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
word-break:break-all;
width: 220rpx;
}
/*文字一行溢出*/
.onelines{
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
flex:1
}
.bjyans{
background-color: #F7F7F7;
word-break: break-all;
padding-bottom: 10rpx;
box-sizing: border-box;
}
\ No newline at end of file
// components/recommend/recommend.js
const app = getApp();
var img_host = app.globalData.ImgPath; //域名
var clientImgPath = app.globalData.clientImgPath;
Component({
/**
* 组件的属性列表
*/
properties: {
For: {
type: Array,
value: []
}
},
/**
* 组件的初始数据
*/
data: {
img_host: img_host, //请求域名
clientImgPath:clientImgPath
},
ready() { //组件中的周期函数
this.setData({
For: parseFloat(this.data.For), //接收页面传递过来的数据
});
console.log(this.data.For)
},
/**
* 组件的方法列表
*/
methods: {
//商品详情
jumpToDetail(e){
let goods_id = e.currentTarget.dataset.goods_id
let cate_id = this.data.curid ? this.data.curid : e.currentTarget.dataset.cate_id
this.setData({
is_open: false
})
wx.navigateTo({
url: '/pages/shop/shops/weidian/weidian_details/weidian_details?goods_id=' + goods_id + '&cate_id=' + cate_id,
})
},
}
})
\ No newline at end of file
{
"usingComponents": {}
}
\ No newline at end of file
<!--components/recommend/recommend.wxml-->
<view class="bgf w1005 brs" style="padding:0 20rpx 24rpx 20rpx;margin-top:-30rpx;box-sizing:border-box;" wx:if="{{For.length!=0}}">
<view wx:for="{{For}}" wx:key="index" bindtap="jumpToDetail" wx:if="{{index<4}}" data-goods_id="{{item.goods_id}}" data-cate_id="{{item.cate_id}}" class="{{index==0?'ys':'yss'}}">
<image src="{{img_host}}/attachs/{{item.photo}}" style="width:240rpx;height:240rpx;" class="br10"></image>
<view class="flex1" style="padding:0 16rpx;position:relative;">
<view style="display: flex;position: relative;height:82rpx">
<view class="s20 cf" style="background: #f64f15;border-radius: 12rpx;padding:6rpx 24rpx 6rpx 24rpx;border-radius: 12rpx;width:80rpx; height:28rpx;position: absolute; display: inline;">鹿马佣金</view>
<text class="twoline" style="text-indent:5em;font-size: 32rpx;font-weight: 800;color: rgba(51,51,51,1);">{{item.title}}
</text>
</view>
<view class="palace">销量{{item.sold_num}}</view>
<!-- <view class="tb">已有{{item.sold_num}}人购买</view> -->
<view class="monetary">
<view>
<view class="commodity_price">
<!-- <text class="price_1">助农价¥</text> -->
<text class="price_2">{{item.price}}元</text>
<!-- <text class="price_1">原价29元</text> -->
</view>
</view>
<view class="commission">
<view style="position: absolute;">
<!-- <image class="commission_1" src="/images/commission/commission_2.png"></image> -->
</view>
<view style="border-bottom-left-radius: 10rpx;border-top-left-radius: 10rpx;text-align: center;z-index: 2;width:150rpx;height: 60rpx;background: rgba(252,217,71);line-height: 60rpx;color: #f64f15;font-weight: bold;font-size: 22rpx"> 返佣金{{item.money}}</view>
<view class="commission_2">下单立返佣金</view>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
/* components/recommend/recommend.wxss */
@import "/style/out.wxss";
.label {
color: #f64f15;
padding: 2rpx 6rpx;
border: 1px solid #f64f15;
margin: 10rpx 26rpx 0 0;
border-radius: 5rpx;
}
.ml-10 {
margin-left: 10rpx;
}
.chain {
position: absolute;
display: inline-block;
}
.evaluate {
display: flex;
}
.evaluate_2 {
color: #F64F15;
font-size: 28rpx;
padding: 0 0 0 4rpx;
margin-top: -4rpx;
}
.num {
color: #6B6B6B;
margin-right: 50rpx;
margin-top: -6rpx;
display: flex;
justify-content: right;
}
.information {
font-size: 24rpx;
color: #333333;
font-weight: 500;
width: 300rpx;
display: flex;
}
.yue {
width: 100rpx;
}
.wai {
padding: 4rpx 10rpx;
color: white;
background-color: tomato;
border-radius: 6rpx;
margin: 0 6rpx;
font-size: 20rpx;
}
.dian {
padding: 4rpx 10rpx;
color: white;
background-color: rgb(23, 139, 235);
border-radius: 6rpx;
margin: 0 6rpx;
font-size: 20rpx;
}
/* 礼品精选 */
.lmzy{
width: 56px;
padding: 6rpx 10rpx 6rpx;
border-radius: 6rpx;
border: 2rpx solid red;
color: red;
text-align: center;
}
.lmzys{
width: 56px;
padding: 4rpx 10rpx 4rpx;
border-radius: 10rpx;
border: 2rpx solid red;
margin: 0 0 0 10rpx;
color: red;
text-align: center;
}
.distance {
width: 84rpx;
}
.monetary{
/* display: flex;
justify-content: space-between;
position: absolute; */
bottom: 0;
/* margin-top: 80rpx; */
}
.zy{
margin: 10rpx 0 16rpx 0;
}
/*文字两行溢出*/
.twoline{
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.monetary_2{
margin: 0 80rpx 0 20rpx;
}
.commodity_price {
/* width: 220rpx; */
height: 40rpx;
color: #FA4545;
font-size: 26rpx;
/* text-align: center; */
line-height: 50rpx;
}
.commodity_price_1{
width: 220rpx;
height: 40rpx;
color: #969696;
text-decoration:line-through;
font-size: 22rpx;
text-align: center;
line-height: 50rpx;
margin: 0 0 0 10rpx;
}
.ys{
padding: 11px;
border: 2px solid #f46f15;
border-right: 4rpx solid #f46f15;
border-bottom-left-radius: 12px;
border-bottom-right-radius: 12px;
border-bottom: 4rpx solid #f46f15;
border-left: 4rpx solid #f64f15;
margin-top: 30rpx;
display: flex;
}
.yss{
border-radius:20rpx;
padding: 20rpx;
border:4rpx solid #f46f15;
display: flex;
margin-top: 30rpx;
}
.tb{
/* font-size: 24px; */
font-weight: 500;
color: rgba(255,115,79,1);
line-height: 26px;
width: 150px;
height: 46rpx;
background: rgba(255,233,204,1);
border-radius: 10px;
text-align: center;
margin: 10rpx 0 10rpx 0;
font-size: 22rpx;
position: relative;
}
.price_1 {
font-size: 20rpx;
font-weight: 500;
}
.price_2 {
font-weight: bold;
font-size: 34rpx;
}
.price_3 {
font-weight: bold;
font-size: 26rpx;
}
.purchase{
padding: 4rpx 16rpx 4rpx;
border-radius:10rpx;
background: linear-gradient(90deg, rgba(243, 0, 9, 1) 0%,rgba(255, 113, 64, 1) 99%);
font-size: 24rpx;
color: #ffffff;
}
/*文字一行溢出*/
.oneline{
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
}
.brs{
border-bottom-right-radius: 20rpx;
border-bottom-left-radius: 20rpx;
}
.palace{
color: #6B6B6B;
font-size: 26rpx;
margin: 12rpx 0 0 0;
}
.commission{
height: 40rpx;
margin-top: 18rpx;
display: flex;
}
.commission_1{
height:44rpx;
width:80rpx ;
position: relative;
}
.commission_2{
height: 60rpx;
width: 200rpx;
background-color: #f64f15;
text-align: center;
line-height: 60rpx;
color: #ffffff;
font-weight: bold;
font-size: 26rpx;
border-bottom-right-radius: 10rpx;
border-top-right-radius: 10rpx;
}
\ No newline at end of file
// components/cremacteric/cremacteric.js
const app = getApp();
var clientImgPath = app.globalData.clientImgPath;
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
flag:false,
wrapAnimate:'wrapAnimate',
bgOpacity:0,
frameAnimate:'frameAnimate',
clientImgPath,
},
/**
* 组件的方法列表
*/
methods: {
showFrame() {
this.setData({ flag: true, wrapAnimate: 'wrapAnimate', frameAnimate: 'frameAnimate' });
},
hideFrame() {
const that= this;
that.setData({ wrapAnimate: 'wrapAnimateOut', frameAnimate: 'frameAnimateOut' });
setTimeout(()=>{
that.setData({ flag: false})
},400)
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--components/cremacteric/cremacteric.wxml-->
<view wx:if='{{flag}}'>
<view class='wrap {{wrapAnimate}}' style='background:rgba(0,0,0,{{bgOpacity}});'></view>
<view catchtap='hideFrame' class='frame-wrapper {{frameAnimate}}'>
<view catchtap='catchNone' class='frame_1'>
<!-- 标题 -->
<view class='title-wrapper tect'>
<view class="btext">温馨提示</view>
</view>
<!-- 内容 -->
<!-- <slot></slot> -->
<view class="content">
为了后期统一渠道,现已关闭鹿马小程序、APP商家提现功能,以后商家提现请前往商家助手进行操作。
</view>
</view>
<view class="close" catchtap='hideFrame'>
<view class="tbimg">
<image src="{{clientImgPath}}/2020/index/group_img/close.png"></image>
</view>
</view>
</view>
</view>
/* components/cremacteric/cremacteric.wxss */
/* 动画 */
.wrapAnimate{
animation: wrapAnimate 0.1s ease-in-out forwards}
@keyframes wrapAnimate{
0%{}
100%{background:rgba(0,0,0,0.35);}
}
.wrapAnimateOut{animation: wrapAnimateOut 0.1s ease-in-out forwards}
@keyframes wrapAnimateOut{
0%{background:rgba(0,0,0,0.35);}
100%{background:rgba(0,0,0,0);}
}
.frameAnimate{animation: frameAnimate 0.2s ease forwards;}
@keyframes frameAnimate{
0%{}
100%{opacity: 1;top:0vh;}
}
.frameAnimateOut{animation: frameAnimateOut 0.2s ease forwards;}
@keyframes frameAnimateOut{
0%{opacity: 1;top:0vh;}
100%{opacity: 0;top:100vh;}
}
/* 内容 */
.frame-wrapper{position: fixed;height:100vh;width:100vw;z-index: 999;top: 50vh;}
.frame_1{background: #fff;position: absolute;width:60vw;padding: 5.9vw 5.9vw 40rpx;border-radius:16rpx;z-index: 999;top: 35%;
left: 11%;
}
.title-wrapper{justify-content: space-between;font-size: 4.9vw;color: #4a4a4a;margin-bottom: 5.9vw;}
.title-wrapper>image{width:3.2vw;height:3.2vw;padding:0 5vw;margin-right:-5vw;}
.flex{display: flex;align-items: center;}
.wrap{position: fixed;z-index: 1;top: 0;left: 0;right: 0;bottom: 0;}
.tect{
text-align: center;
}
.btext{font-size:36rpx;
font-weight:800;
color:rgba(153,153,153,1);
border-bottom: 1px solid rgba(153,153,153,1);
padding: 0 0 20rpx 0;
}
.btxia{
font-size:24rpx;
font-weight:500;
color:rgba(128,128,128,1);
}
.content{
text-align: center;
color:rgba(128,128,128,1);
}
.close{
position: relative;
}
.tbimg{
position: absolute;
bottom: -280rpx;
width: 58rpx;
height: 58rpx;
top: 820rpx;
left: 320rpx;
}
\ No newline at end of file
// components/drawing/drawing.js
// components/group/group.json.js
const app = getApp();
var clientImgPath = app.globalData.clientImgPath;
Component({
properties: {
},
data: {
flag: false,
wrapAnimate: 'wrapAnimate',
bgOpacity: 0,
frameAnimate: 'frameAnimate',
painting: {},
shareImage: '',
clientImgPath,
},
// onLoad: function () {
// var that=this;
// that.eventDraw()
// },
methods: {
// 绘画
eventDraw() {
wx.showLoading({
title: '绘制分享图片中',
mask: true
})
this.setData({
painting: {
width: 375,
height: 555,
clear: true,
views: [
{
type: 'image',
url: 'https://hybrid.xiaoying.tv/miniprogram/viva-ad/1/1531103986231.jpeg',
top: 0,
left: 0,
width: 375,
height: 555
},
{
type: 'image',
url: 'https://wx.qlogo.cn/mmopen/vi_32/DYAIOgq83epJEPdPqQVgv6D8bojGT4DrGXuEC4Oe0GXs5sMsN4GGpCegTUsBgL9SPJkN9UqC1s0iakjQpwd4h4A/132',
top: 27.5,
left: 29,
width: 55,
height: 55
},
{
type: 'image',
url: 'https://hybrid.xiaoying.tv/miniprogram/viva-ad/1/1531401349117.jpeg',
top: 27.5,
left: 29,
width: 55,
height: 55
},
{
type: 'text',
content: '您的好友【kuckboy】',
fontSize: 16,
color: '#402D16',
textAlign: 'left',
top: 33,
left: 96,
bolder: true
},
{
type: 'text',
content: '发现一件好货,邀请你一起0元免费拿!',
fontSize: 15,
color: '#563D20',
textAlign: 'left',
top: 59.5,
left: 96
},
{
type: 'image',
url: 'https://hybrid.xiaoying.tv/miniprogram/viva-ad/1/1531385366950.jpeg',
top: 136,
left: 42.5,
width: 290,
height: 186
},
{
type: 'image',
url: 'https://hybrid.xiaoying.tv/miniprogram/viva-ad/1/1531385433625.jpeg',
top: 443,
left: 85,
width: 68,
height: 68
},
{
type: 'text',
content: '正品MAC魅可口红礼盒生日唇膏小辣椒Chili西柚情人',
fontSize: 16,
lineHeight: 21,
color: '#383549',
textAlign: 'left',
top: 336,
left: 44,
width: 287,
MaxLineNumber: 2,
breakWord: true,
bolder: true
},
{
type: 'text',
content: '¥0.00',
fontSize: 19,
color: '#E62004',
textAlign: 'left',
top: 387,
left: 44.5,
bolder: true
},
{
type: 'text',
content: '原价:¥138.00',
fontSize: 13,
color: '#7E7E8B',
textAlign: 'left',
top: 391,
left: 110,
textDecoration: 'line-through'
},
{
type: 'text',
content: '长按识别图中二维码帮我砍个价呗~',
fontSize: 14,
color: '#383549',
textAlign: 'left',
top: 460,
left: 165.5,
lineHeight: 20,
MaxLineNumber: 2,
breakWord: true,
width: 125
}
]
}
})
},
eventSave() {
wx.saveImageToPhotosAlbum({
filePath: this.data.shareImage,
success(res) {
wx.showToast({
title: '保存图片成功',
icon: 'success',
duration: 2000
})
}
})
this.eventDraw()
},
eventGetImage(event) {
console.log(event)
wx.hideLoading()
const { tempFilePath, errMsg } = event.detail
if (errMsg === 'canvasdrawer:ok') {
this.setData({
shareImage: tempFilePath
})
}
},
// 弹窗
showFrame() {
this.setData({ flag: true, wrapAnimate: 'wrapAnimate', frameAnimate: 'frameAnimate' });
},
hideFrame() {
const that = this;
that.setData({ wrapAnimate: 'wrapAnimateOut', frameAnimate: 'frameAnimateOut' });
setTimeout(() => {
that.setData({ flag: false })
}, 400)
},
catchNone() {
//阻止冒泡
},
_showEvent() {
this.triggerEvent("showEvent");
},
_hideEvent() {
this.triggerEvent("hideEvent");
}
}
})
{
"component": true,
"usingComponents": {
"canvasdrawer": "/components/canvasdrawer/canvasdrawer"
}
}
\ No newline at end of file
<!--components/drawing/drawing.wxml-->
<!-- <text>components/drawing/drawing.wxml</text> -->
<!--components/group/group.json.wxml-->
<view wx:if='{{flag}}'>
<view class='wrap {{wrapAnimate}}' style='background:rgba(0,0,0,{{bgOpacity}});'></view>
<view catchtap='hideFrame' class='frame-wrapper {{frameAnimate}}'>
<view catchtap='catchNone' class='frame_1'>
<!-- 标题 -->
<view class='title-wrapper tect'>
<view class="btext">可参与的拼团</view>
</view>
<!-- 内容 -->
<!-- <view class="container">
<image src="{{shareImage}}" class="share-image"></image>
<canvasdrawer painting="{{painting}}" class="canvasdrawer" bind:getImage="eventGetImage" />
</view> -->
<view class="container">
<image src="{{shareImage}}" class="share-image"></image>
<canvasdrawer painting="{{painting}}" class="canvasdrawer" bind:getImage="eventGetImage" />
<button bind:tap="eventDraw">绘制</button>
<button bind:tap="eventSave">保存到本地</button>
</view>
<view class="botton" catchtap='hideFrame'>
<view class="tbimg">
<image src="{{clientImgPath}}/2020/index/group_img/close.png"></image>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
/* components/drawing/drawing.wxss */
/* 内容 */
.title_group{
font-weight: bold;
padding: 20rpx;
text-align: center;
}
.ali-c{
display:flex;
align-items: center;
padding: 0 20rpx;
}
.ptleimg{
width: 60rpx;height: 60rpx;border-radius: 50%;overflow: hidden;
}
.space{
padding: 0 0 0 20rpx;
}
.ptrebtn_1{
width:140rpx;
height:50rpx;
background:rgba(246,79,21,1);
border-radius:30rpx;
line-height: 50rpx;
color: #fff;
font-size:26rpx;
font-weight:600;
text-align: center;
}
.ping{
display: flex;
justify-content: space-between;
padding: 10px 0 10px 0;
}
.icon{
position: fixed;
margin-bottom: 20px;
}
image{
width: 100%;
height: 100%;
}
.tbimg{
position: absolute;
bottom: -150rpx;
width: 58rpx;
height: 58rpx;
}
.xian{
width: 100%;
height: 1px;
background: rgba(245, 242, 242, 1);
}
/* 弹窗 */
.wrapAnimate{
animation: wrapAnimate 0.5s ease-in-out forwards}
@keyframes wrapAnimate{
0%{}
100%{background:rgba(0,0,0,0.35);}
}
.wrapAnimateOut{animation: wrapAnimateOut 0.4s ease-in-out forwards}
@keyframes wrapAnimateOut{
0%{background:rgba(0,0,0,0.35);}
100%{background:rgba(0,0,0,0);}
}
.frameAnimate{animation: frameAnimate 0.5s ease forwards;}
@keyframes frameAnimate{
0%{}
100%{opacity: 1;top:0vh;}
}
.frameAnimateOut{animation: frameAnimateOut 0.4s ease forwards;}
@keyframes frameAnimateOut{
0%{opacity: 1;top:0vh;}
100%{opacity: 0;top:100vh;}
}
.frame-wrapper{position: fixed;height:100vh;width:100vw;z-index: 999;top: 50vh;}
.frame_1{background: #fff;
position: absolute;
width: 76vw;
z-index: 999;
top: 6%;
left: 12%;
height: 760rpx;
}
.title-wrapper{justify-content: space-between;font-size: 4.9vw;color: #4a4a4a;margin-bottom: 5.9vw;}
.title-wrapper>image{width:3.2vw;height:3.2vw;padding:0 5vw;margin-right:-5vw;}
.flex{display: flex;align-items: center;}
.wrap{position: fixed;z-index: 1;top: 0;left: 0;right: 0;bottom: 0;}
.tect{
text-align: center;
}
.btext{font-size:36rpx;
font-weight:800;
color:rgba(26,26,26,1);}
.btxia{
font-size:24rpx;
font-weight:500;
color:rgba(128,128,128,1);
}
.kuai{
max-height: 550rpx;overflow-x:hidden;
text-align: c;
}
.botton{
width:100%;
border-radius:10rpx;
font-size:40rpx;
font-weight:800;
color:rgba(255,255,255,1);
line-height: 88rpx;
position: relative;
text-align: center;
color: black;
}
.botton {
margin-left: 260rpx;
color: black;
}
.share-image {
width: 100%;
height: 400rpx;
border: 1px solid black;
}
.tbimg{
position: absolute;
bottom: -150rpx;
width: 58rpx;
height: 58rpx;
}
\ No newline at end of file
// components/recommend/recommend.js
const app = getApp();
var img_host = app.globalData.ImgPath; //域名
var clientImgPath = app.globalData.clientImgPath;
Component({
/**
* 组件的属性列表
*/
properties: {
For: {
type: Array,
value: []
}
},
/**
* 组件的初始数据
*/
data: {
img_host: img_host, //请求域名
clientImgPath:clientImgPath,
},
ready() { //组件中的周期函数
this.setData({
For: parseFloat(this.data.For), //接收页面传递过来的数据
});
},
/**
* 组件的方法列表
*/
methods: {
// 跳转到商家店铺
jumpDd: function (e) {
let shop_id = e.currentTarget.dataset.shop_id
let is_ld = e.currentTarget.dataset.is_ld
let shop_type = e.currentTarget.dataset.shop_type
let hotel_id = e.currentTarget.dataset.hotel_id
if (shop_type == 'ele') {
wx.navigateTo({
url: '/pages/shop/shops/ele/ele?shop_id=' + shop_id,
})
} else if (shop_type == 'hotel') {
wx.navigateTo({
url: '/pages/shop/hotel/hotel_details/hotel_details?hotel_id=' + hotel_id,
})
} else {
wx.navigateTo({
url: '/pages/shop/shops/weidian/home_page_weidian/home_page_weidian?shop_id=' + shop_id,
})
}
},
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--components/recommend/recommend.wxml-->
<view class="bgf w1005 br20" style="padding:40rpx 0 24rpx 20rpx;margin-bottom:109rpx;" wx:if="{{For.length!=0}}">
<view
class="flex mt30"
wx:for="{{For}}"
wx:key="index"
bindtap="jumpDd"
data-is_ld="{{item.liandshangj}}"
data-shop_type="{{item.shop_type}}"
data-shop_id="{{item.shop_id}}"
data-hotel_id="{{item.hotel_id}}"
>
<!-- <image src="{{clientImgPath}}/2020/index/group_img/index_img/chain.png" style="width:70rpx;height:30rpx;" class="chain"></image> -->
<image src="{{img_host}}/attachs/{{item.logo}}" style="width:162rpx;height:157rpx;" class="br10"></image>
<view class="flex1" style="padding:0 21rpx;">
<view class="fwb mb10 s30">{{item.shop_name}}</view>
<view class="flex acen jusb">
<view class="evaluate">
<!-- 星星评价 -->
<image src="{{clientImgPath}}/2020/index/group_img/index_img/good.png" style="width:25rpx;height:25rpx;"></image>
<text class="evaluate_2">5.0</text>
</view>
<view class="s26 num" style="color:#6B6B6B;">
<text class="yue"> 销量{{item.month_num}}</text>
<text class="wai">外</text>
<text class="dian">店</text>
</view>
<view class="s24 distance" style="color:#6C6C6C;margin-top:-4rpx">{{item.d}}</view>
</view>
<view class="flex acen jusb">
<view class="flex acen" >
<!-- <view class="s26 " style="color:#6C6C6C;" wx:if="{{item.shop_type=='ele'}}">小吃</view>
<view class="s26 " style="color:#6C6C6C;" wx:if="{{item.shop_type=='weidian'}}">商城</view>
<view class="s26 " style="color:#6C6C6C;" wx:if="{{item.shop_type=='hotel'}}">酒店</view> -->
<view class="s26 information" ><text style="width: 130rpx;">人均{{item['fans_num']}} </text>
<text>人配送{{item['view']}}次</text>
</view>
</view>
<view class="s20 cf" wx:if="{{item.run_code}}" style="padding:2rpx 4rpx;background:#f64f15;border-radius:5rpx;">鹿马配送</view>
</view>
<!-- <view class="disf acen">
<view class="s24 label" >满20减5</view>
<view class="s24 label" >满40减10</view>
<view class="s24 label" >满60减15</view>
</view> -->
<view class="s24 mt15 ovd1" style="color:#6B6B6B;">{{item['addr']}}</view>
</view>
</view>
</view>
/* components/recommend/recommend.wxss */
@import "/style/out.wxss";
.label{
color:#f64f15;
padding:2rpx 6rpx;
border:1px solid #f64f15;
margin:10rpx 26rpx 0 0;
border-radius: 5rpx;
}
.ml-10{
margin-left: 10rpx;
}
.chain{
position: absolute;
display: inline-block;
}
.evaluate{
display: flex;
}
.evaluate_2{
color: #F64F15;
font-size: 28rpx;
padding: 0 0 0 4rpx;
margin-top: -4rpx;
}
.num{
color: #6B6B6B;
margin-right: 80rpx;
margin-top: -6rpx;
display: flex;
justify-content: right;
}
.information{
font-size: 24rpx;
color: #333333;
font-weight: 500;
width: 300rpx;
display: flex;
}
.yue{
width: 100rpx;
}
.wai{
padding:2rpx 10rpx;
color: white;
background-color: tomato;
border-radius: 6rpx;
margin: 0 6rpx;
font-size: 20rpx;
}
.dian{
padding:2rpx 10rpx;
color: white;
background-color: rgb(23, 139, 235);
border-radius: 6rpx;
margin: 0 6rpx;
font-size: 20rpx;
}
.distance{
width: 84rpx;
}
\ No newline at end of file
const app = getApp();
var img_host = app.globalData.ImgPath; //域名
Component({
/**
* 组件的属性列表
*/
properties: {
array: {
type: Array,
value: []
}
},
/**
* 组件的初始数据
*/
data: {
img_host: img_host, //请求域名
},
ready() { //组件中的周期函数
},
/**
* 组件的方法列表
*/
methods: {
//商品详情
jumpToDetail(e) {
let item = e.currentTarget.dataset.item
let goods_id = item.goods_id;
let cate_id = item.cate_id;
if( item.miao == 0 ){
wx.navigateTo({
url: '/pages/shop/shops/weidian/weidian_details/weidian_details?goods_id=' + goods_id + '&cate_id=' + cate_id,
})
}else{
wx.navigateTo({
url: '/pages/shop/shops/weidian/weidian_details/productMs/productMs?goods_id=' + goods_id + '&cate_id=' + cate_id,
})
}
},
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {
"Stars":"/components/Stars/Stars"
}
}
\ No newline at end of file
<view class="disf mb20">
<view style="width:334rpx;" class="br15 mr20 item mb-20 ovH" wx:for="{{array}}" wx:key="index" wx:for-item="goods">
<view
style="padding:0 8rpx;height: 32rpx;background: #F64F15;color: #fff;text-align: center;font-size:20rpx;position: absolute;z-index:99;"
wx:if="{{goods.orderby != 100}}">
优选
</view>
<view data-item="{{goods}}" data-goods_id="{{goods.goods_id}}" data-cate_id="{{goods.cate_id}}"
catchtap="jumpToDetail">
<image
src="{{img_host}}/attachs/{{goods.img}}"
class="w1005"
style="height:298rpx"
>
</image>
<view class="bgf">
<view class="bgf" style="padding:15rpx 17rpx 30rpx 15rpx;">
<view class="ovd2 s30" style="min-height:80rpx">{{goods.title}}</view>
<view class="flex acen jusb mt-10">
<view class="s26 fwb" style="color:#f64f15;">¥<text
class="s34">{{goods.miao == 0? goods.disprice:goods.miao}}</text>
</view>
<view class="c99 s26" style="margin-top:10rpx;">已售
{{goods.month_num}}</view>
</view>
</view>
</view>
<view class="c99 s26 gitShare" wx:if="{{goods.commission==0?false:true}}">分享赚{{goods.commission}}元
</view>
<view class="c99 s26 gitShare" wx:if="{{goods.commission==0?true:false}}">分享好友</view>
</view>
</view>
</view>
\ No newline at end of file
@import "/style/out.wxss";
@import"/utils/css/public.wxss";
.gitShare{
font-size: 26rpx;
background-color: #f64f15;
color: white;
text-align: center;
height: 44rpx;
line-height: 44rpx;
}
.item:nth-child(2n){
margin-right: 0;
}
\ No newline at end of file
// components/group/group.json.js
const app = getApp();
var clientImgPath = app.globalData.clientImgPath;
Component({
properties: {
grouplist:{
type:Array,
value:[]
}
},
data: {
flag:false,
wrapAnimate:'wrapAnimate',
bgOpacity:0,
frameAnimate:'frameAnimate',
clientImgPath,
},
methods: {
bandshare(e){
console.log(e)
wx.navigateTo({
url: '/pages/shop/shops/weidian/weidian_group_3/weidian_group_3'
})
},
showFrame() {
this.setData({ flag: true, wrapAnimate: 'wrapAnimate', frameAnimate: 'frameAnimate' });
},
hideFrame() {
const that= this;
that.setData({ wrapAnimate: 'wrapAnimateOut', frameAnimate: 'frameAnimateOut' });
setTimeout(()=>{
that.setData({ flag: false})
},400)
},
catchNone(){
//阻止冒泡
},
_showEvent() {
this.triggerEvent("showEvent");
},
_hideEvent() {
this.triggerEvent("hideEvent");
}
}
})
{
"component": true,
"usingComponents": {
"van-icon": "/@vant/weapp/lib/icon/index"
}
}
\ No newline at end of file
<!--components/group/group.json.wxml-->
<view wx:if='{{flag}}'>
<view class='wrap {{wrapAnimate}}' style='background:rgba(0,0,0,{{bgOpacity}});'></view>
<view catchtap='hideFrame' class='frame-wrapper {{frameAnimate}}'>
<view catchtap='catchNone' class='frame_1'>
<!-- 标题 -->
<view class='title-wrapper tect'>
<view class="btext">可参与的拼团</view>
</view>
<!-- 内容 -->
<!-- <slot></slot> -->
<view class="content">
<view class="ptleb_1">
<view wx:for="{{grouplist}}" wx:key='key'>
<view class="mb-20 jus-b pd-24 ping">
<view class="ali-c pd-5">
<view class="ptleimg mr-10">
<image src="{{item.face}}"></image>
</view>
<view class="space">{{item.nickname}}</view>
</view>
<view>
<button class="ptrebtn_1 ml-20" bindtap="bandshare">去拼单</button>
</view>
</view>
<view class="xian" data-type="" />
</view>
</view>
</view>
<view class="botton" catchtap='hideFrame'>
<view class="tbimg">
<image src="{{clientImgPath}}/2020/index/group_img/close.png"></image>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
/* 内容 */
.title_group{
font-weight: bold;
padding: 20rpx;
text-align: center;
}
.ali-c{
display:flex;
align-items: center;
padding: 0 20rpx;
}
.ptleimg{
width: 60rpx;height: 60rpx;border-radius: 50%;overflow: hidden;
}
.space{
padding: 0 0 0 20rpx;
}
.ptrebtn_1{
width:140rpx;
height:50rpx;
background:rgba(246,79,21,1);
border-radius:30rpx;
line-height: 50rpx;
color: #fff;
font-size:26rpx;
font-weight:600;
text-align: center;
}
.ping{
display: flex;
justify-content: space-between;
padding: 10px 0 10px 0;
}
.icon{
position: fixed;
margin-bottom: 20px;
}
image{
width: 100%;
height: 100%;
}
.tbimg{
position: absolute;
bottom: -150rpx;
width: 58rpx;
height: 58rpx;
}
.xian{
width: 100%;
height: 1px;
background: rgba(245, 242, 242, 1);
}
.wrapAnimate{
animation: wrapAnimate 0.5s ease-in-out forwards}
@keyframes wrapAnimate{
0%{}
100%{background:rgba(0,0,0,0.35);}
}
.wrapAnimateOut{animation: wrapAnimateOut 0.4s ease-in-out forwards}
@keyframes wrapAnimateOut{
0%{background:rgba(0,0,0,0.35);}
100%{background:rgba(0,0,0,0);}
}
.frameAnimate{animation: frameAnimate 0.5s ease forwards;}
@keyframes frameAnimate{
0%{}
100%{opacity: 1;top:0vh;}
}
.frameAnimateOut{animation: frameAnimateOut 0.4s ease forwards;}
@keyframes frameAnimateOut{
0%{opacity: 1;top:0vh;}
100%{opacity: 0;top:100vh;}
}
.frame-wrapper{position: fixed;height:100vh;width:100vw;z-index: 999;top: 50vh;}
.frame_1{background: #fff;position: absolute;width:60vw;padding: 5.9vw 5.9vw 40rpx;border-radius:16rpx;z-index: 999;top: 15%;
left: 14%;
}
.title-wrapper{justify-content: space-between;font-size: 4.9vw;color: #4a4a4a;margin-bottom: 5.9vw;}
.title-wrapper>image{width:3.2vw;height:3.2vw;padding:0 5vw;margin-right:-5vw;}
.flex{display: flex;align-items: center;}
.wrap{position: fixed;z-index: 1;top: 0;left: 0;right: 0;bottom: 0;}
.tect{
text-align: center;
}
.btext{font-size:36rpx;
font-weight:800;
color:rgba(26,26,26,1);}
.btxia{
font-size:24rpx;
font-weight:500;
color:rgba(128,128,128,1);
}
.content{
max-height: 550rpx;overflow-x:hidden;
text-align: c;
}
.botton{
width:100%;
height:88rpx;
/* background:rgba(255,105,0,1); */
border-radius:10rpx;
font-size:40rpx;
font-weight:800;
color:rgba(255,255,255,1);
line-height: 88rpx;
position: relative;
text-align: center;
color: black;
width: 10%;
height: 50%;
margin-left: 210rpx;
color: black;
}
/* .botton {
width: 10%;
height: 50%;
margin-left: 210rpx;
color: black;
} */
\ No newline at end of file
const app = getApp();
Component({
/**
* 组件的属性列表
*/
properties: {
show:{
type:Boolean,
default:()=>{
return false
}
}
},
/**
* 组件的初始数据
*/
data: {
bottom:-200,
isShow:false,
},
observers: {
show(e) {
this.setData({
isShow:e
})
if(this.data.isShow){
this.setData({
bottom:0,
})
}else{
this.sctcimg();
}
}
},
/**
* 组件的方法列表
*/
methods: {
sctcimg(){
this.setData({
bottom:-200,
isShow:false
})
},
sctcimg2(){
this.triggerEvent('sctcimg',{});
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!-- 优惠券过期提醒 -->
<view class="ingdexhb" style="bottom:{{bottom}}rpx;transition:2s ease;">
<view class="ali-c jus-b">
<view class="ingdextext" bindtap="touseThe">
<text >您还未登录,请立即登录?</text>
</view>
<view class="s28 cf ingdexsc" catchtap="sctcimg2" >去登录</view>
</view>
</view>
@import "/style/out.wxss";
@import"/utils/css/public.wxss";
.ingdexhb{
width: 100%;
height: 100rpx;
line-height: 100rpx;
padding: 0 24rpx;
box-sizing: border-box;
position: fixed;
left: 0;
background:rgba(0, 0, 0, 0.7);
z-index: 99999999999;
}
.ingdextext{
width: 100%;
font-size: 32rpx;
color: #fff;
padding-left: 26rpx;
}
.ingdexsc{
width: 160rpx;
height: 60rpx;
text-align: center;
line-height: 60rpx;
border-radius: 30rpx;
background:#F64F15;
}
\ No newline at end of file
// components/mixture.js
Component({
/**
* 组件的属性列表
*/
properties: {
needs_pay:{
type: Number,
value: ''
},
commission:{
type: Number,
value: 1
},
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!-- <view class="boxs">
<view class="topbox mt-20"> -->
<view class="li_boxs sz_20 bt_hei">
<view class="ali-zz">
<view style="font-weight: bold;">可勾选抵现方式</view>
<view class="payment1" bindtap="bindpaymentss" style="padding: 6rpx 20rpx 0 20rpx">
<image src="/images/payment/payment3.png"></image>
</view>
</view>
<view class="flex" style="padding:20rpx 0 10rpx 0;">
<view class="payment1" style="padding: 0 10rpx 0 0; ">
<image src="/images/payment/payment2.png"></image>
</view>
<view>鹿马余额 <text style="color:#F64f15">{{needs_pay}}</text>分</view>
<view class="payment1" style="margin-left: auto;">
<image bindtap="bindpayment" data-index="{{bindshow?'':money}}" class="{{bindshow?'nome':'beack'}}"
src="/images/payment/payment5.png"></image>
<image bindtap="bindpayment" data-index="{{bindshow?'':money}}" class="{{bindshow?'beack':'nome'}}"
src="/images/payment/payment4.png"></image>
</view>
</view>
<view class="flex" style="padding: 10rpx 0 10rpx 0;">
<view class="payment1" style="padding: 0 10rpx 0 0;">
<image src="/images/payment/payment1.png"></image>
</view>
<view>我的佣金 <text style="color:#F64f15">{{commission}}</text>元</view>
<view class="payment1" style="margin-left: auto;">
<image bindtap="bindpayments" data-index="{{bindshows?'':commission}}"
class="{{bindshows?'nome':'beack'}}" src="/images/payment/payment5.png"></image>
<image bindtap="bindpayments" data-index="{{bindshows?'':commission}}"
class="{{bindshows?'beack':'nome'}}" src="/images/payment/payment4.png"></image>
</view>
</view>
</view>
<!-- </view>
</view> -->
\ No newline at end of file
.payment1{
width: 40rpx;
height: 40rpx;
}
.ali-zz{
display: flex;
align-items: center;
}
.beack{
display: block;
}
.nome{
display: none;
}
.dspla{
display: flex;
align-items: center;
}
.li_boxs{
padding: 20rpx 0;
box-sizing: border-box;
}
.tubiaoimg{
width:44rpx;
height:44rpx;
}
.dspjc{
display: flex;
align-items: center;
justify-content: space-between;
}
.flex{
display: flex;
}
.boxs {
width: 100%;
padding: 24rpx;
box-sizing: border-box;
}
.topbox {
width: 100%;
background: rgba(255,255,255,1);
border-radius: 14rpx;
padding: 30rpx 30rpx;
box-sizing: border-box;
}
\ No newline at end of file
// components/pop-comment/pop-comment.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
isClose:true,
},
/**
* 组件的方法列表
*/
methods: {
close(){
console.log(this.data.isClose)
this.triggerEvent('isclose',this.data.isClose);
console.log(this.data.isClose)
}
}
})
{
"component": true,
"usingComponents": {
"comment-top":"/components/comment-top/comment-top"
}
}
\ No newline at end of file
<!--components/pop-comment/pop-comment.wxml-->
<!-- {{popshow?'':'hidden'}} -->
<view>
<view class='Popup' >
<view style="padding:24rpx;position:re">共12条评论</view>
<view style="overflow-y: scroll;height: 100%;width: 100%;">
</view>
</view>
<view class='mask' catchtouchmove="true" bindtap='close'></view>
</view>
\ No newline at end of file
/* components/pop-comment/pop-comment.wxss */
.Popup {
width: 100%;
background-color: #fff;
position: fixed;
left: 33%;
margin-left: -250rpx;
transform: translateY(-50%);
z-index: 320;
height: 760rpx;
bottom: -416rpx;
border-top-left-radius: 40rpx;
border-top-right-radius: 40rpx;
overflow-y: scroll;
}
.hidden{
display: none;
}
.flex {
display: flex;
}
.mask {
position: fixed;
top: 0;
right: 0;
left: 0;
bottom: 0;
background-color: rgba(0, 0, 0, 0.65);
z-index: 310;
}
\ No newline at end of file
// components/recommend/recommend.js
const app = getApp();
var img_host = app.globalData.ImgPath; //域名
var clientImgPath = app.globalData.clientImgPath;
Component({
/**
* 组件的属性列表
*/
properties: {
For: {
type: Array,
value: []
}
},
/**
* 组件的初始数据
*/
data: {
img_host: img_host, //请求域名
clientImgPath:clientImgPath
},
ready() { //组件中的周期函数
this.setData({
For: parseFloat(this.data.For), //接收页面传递过来的数据
});
console.log(this.data.For)
},
/**
* 组件的方法列表
*/
methods: {
//商品详情
jumpToDetail(e){
let item = e.currentTarget.dataset.item
let goods_id = item.id
let cate_id = this.data.curid ? this.data.curid : item.cate_id
this.setData({
is_open: false
})
if(item.miao == 0){
wx.navigateTo({
url: '/pages/shop/shops/weidian/weidian_details/weidian_details?goods_id=' + goods_id + '&cate_id=' + cate_id,
})
}else{
wx.navigateTo({
url: '/pages/shop/shops/weidian/weidian_details/productMs/productMs?goods_id=' + goods_id + '&cate_id=' + cate_id,
})
}
},
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--components/recommend/recommend.wxml-->
<view class="bgf w1005 br20" style="padding:10rpx 20rpx 24rpx 20rpx;margin-bottom:109rpx;" wx:if="{{For.length!=0}}">
<view class="flex mt30" style="border-bottom:2rpx solid #EFEFEF;padding:0 0 20rpx 0;" wx:for="{{For}}" wx:key="index" bindtap="jumpToDetail" data-item="{{item}}" >
<view style="padding:0 8rpx;height: 32rpx;background: #F64F15;color: #fff;text-align: center;font-size:20rpx;position: absolute;z-index:99;" wx:if="{{item.orderby != 100}}">
优选
</view>
<image src="{{img_host}}/attachs/{{item.img}}" style="width:240rpx;height:240rpx;" class="br10"></image>
<view class="flex1" style="padding:0 21rpx;position:relative;">
<view class="fwb mb10 s30 twoline" >{{item.title}}</view>
<view class="flex acen jusb">
</view>
<view class="flex acen jusb zy" >
<view class="flex acen" style="maigin:0">
<view class="s26 information flex">
<text class="lmzy">鹿马自营</text>
<!-- <text class="lmzys">精美礼品</text> -->
<text class="lmzys" wx:if="{{item.commission==0?false:true}}" >分享赚{{item.commission}}元</text>
<text class="lmzys" wx:if="{{item.commission==0?true:false}}" >分享好友</text>
</view>
</view>
<!-- <view class="s20 cf" style="padding:2rpx 4rpx;background:#f64f15;border-radius:5rpx;">鹿马配送</view> -->
</view>
<view style="font-size: 26rpx;color:#B4B4B4;">已有{{item.sold_num}}人购买</view>
<view class="monetary">
<view style=" display:flex;width:160rpx;">
<view class="commodity_price">
<text class="price_1">¥</text>
<text class="price_2">{{item.miao==0? item.disprice:item.miao}}</text>
</view>
<!-- <view class="commodity_price_1">
<text class="price_1">¥</text>
<text class="price_3">{{item.price}}</text>
</view> -->
</view>
<view style="margin-left:100rpx;">
<text class="purchase">立即购买</text>
</view>
</view>
</view>
</view>
</view>
\ No newline at end of file
/* components/recommend/recommend.wxss */
@import "/style/out.wxss";
.label {
color: #f64f15;
padding: 2rpx 6rpx;
border: 1px solid #f64f15;
margin: 10rpx 26rpx 0 0;
border-radius: 5rpx;
}
.ml-10 {
margin-left: 10rpx;
}
.chain {
position: absolute;
display: inline-block;
}
.evaluate {
display: flex;
}
.evaluate_2 {
color: #F64F15;
font-size: 28rpx;
padding: 0 0 0 4rpx;
margin-top: -4rpx;
}
.num {
color: #6B6B6B;
margin-right: 50rpx;
margin-top: -6rpx;
display: flex;
justify-content: right;
}
.information {
font-size: 24rpx;
color: #333333;
font-weight: 500;
/* width: 300rpx; */
display: flex;
}
.yue {
width: 100rpx;
}
.wai {
padding: 4rpx 10rpx;
color: white;
background-color: tomato;
border-radius: 6rpx;
margin: 0 6rpx;
font-size: 20rpx;
}
.dian {
padding: 4rpx 10rpx;
color: white;
background-color: rgb(23, 139, 235);
border-radius: 6rpx;
margin: 0 6rpx;
font-size: 20rpx;
}
/* 礼品精选 */
.lmzy{
width: 56px;
padding: 6rpx 10rpx 6rpx;
border-radius:10rpx;
border: 2rpx solid red;
color: red;
text-align: center;
}
.lmzys{
/* width: 56px; */
padding: 4rpx 10rpx 4rpx;
border-radius: 10rpx;
border: 2rpx solid red;
margin: 0 0 0 10rpx;
color: red;
text-align: center;
}
.distance {
width: 84rpx;
}
.monetary{
display: flex;
justify-content: space-between;
position: absolute;
bottom: 0;
/* margin-top: 80rpx; */
}
.zy{
margin: 1rpx 0 6rpx 0;
}
/*文字两行溢出*/
.twoline{
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
.monetary_2{
margin: 0 80rpx 0 20rpx;
}
.commodity_price {
width: 220rpx;
height: 40rpx;
color: #FA4545;
font-size: 26rpx;
/* text-align: center; */
line-height: 50rpx;
}
.commodity_price_1{
width: 220rpx;
height: 40rpx;
color: #969696;
text-decoration:line-through;
font-size: 22rpx;
text-align: center;
line-height: 50rpx;
margin: 0 0 0 10rpx;
}
.price_1 {
font-size: 20rpx;
font-weight: 500;
}
.price_2 {
font-weight: bold;
font-size: 34rpx;
}
.price_3 {
font-weight: bold;
font-size: 26rpx;
}
.purchase{
padding: 4rpx 10rpx 4rpx;
border-radius: 6rpx;
background-color: red;
font-size: 24rpx;
color: #ffffff;
}
/*文字一行溢出*/
.oneline{
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 1;
overflow: hidden;
}
\ No newline at end of file
const app = getApp();
var clientImgPath = app.globalData.clientImgPath;
Component({
/**
* 组件的属性列表
*/
properties: {
//人数
numbers:{
type:String,
default:"0",
}
},
/**
* 组件的初始数据
*/
data: {
// 隐藏
hideModal: true, //模态框的状态 true-隐藏 false-显示
clientImgPath: clientImgPath
},
/**
* 组件的方法列表
*/
methods: {
// 显示遮罩层
showModal: function () {
var that = this;
that.setData({
hideModal: false,
isFolded: false,
})
var animation = wx.createAnimation({
duration: 0,//动画的持续时间 默认400ms 数值越大,动画越慢 数值越小,动画越快
timingFunction: 'ease',//动画的效果 默认值是linear
})
this.animation = animation
setTimeout(function () {
that.fadeIn();//调用显示动画
}, 0)
},
// 隐藏遮罩层
hideModal: function () {
var that = this;
var animation = wx.createAnimation({
duration: 0,//动画的持续时间 默认400ms 数值越大,动画越慢 数值越小,动画越快
timingFunction: 'ease',//动画的效果 默认值是linear
})
this.animation = animation
that.fadeDown();//调用隐藏动画
setTimeout(function () {
that.setData({
hideModal: true,
isFolded: true,
})
}, 0)//先执行下滑动画,再隐藏模块
//触发父组件的提交事件
},
//确定按点击后
confirm(){
this.hideModal();//隐藏
this.triggerEvent("formsubmit", {});//提交表单
},
//动画集
fadeIn: function () {
this.animation.translateY(0).step()
this.setData({
animationData: this.animation.export()//动画实例的export方法导出动画数据传递给组件的animation属性
})
},
fadeDown: function () {
this.animation.translateY(300).step()
this.setData({
animationData: this.animation.export(),
})
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--components/prizemodel/prizemodel.wxml-->
<!-- <text>components/prizemodel/prizemodel.wxml</text> -->
<!-- 活动抽奖的时候 添加活动抽奖的弹窗提示 -->
<!--components/dialog/tooltiptext/tooltiptext.wxml-->
<view class="modals modals-bottom-dialog" hidden="{{hideModal}}">
<view class="modals-cancelss" bindtap="hideModal"></view>
<view class="id-dialog-bodys bottom-pos" animation="{{animationData}}">
<!-- <view class="te_ct sz_34 bt_hei">什么是免费充值购买?</view>
<view class="id_text_top"><text>用户只需要下单时选择免费专区充值产品对应的价格,即可免费获得该产品,充值的费用将直接转入我的-余额中,该充值的费用可以去平台任意商家进行消费。</text></view>
<button class="id_yh_btn"bindtap='hideModal'>知道了</button> -->
<image class="headimg" src="{{clientImgPath}}/images/luckdraw/modelheads2.png"></image>
<view class="haed_bodys">
<view class="msgs">您已选择了满 <text class="text">{{numbers}}</text>人自带开奖</view>
<view class="msgs">请您三思而后行</view>
<button class="butss" bindtap='confirm' >确认发布</button>
</view>
</view>
</view>
/* components/dialog/tooltiptext/tooltiptext.wxss */
@import"/utils/css/public.wxss";
/* 弹窗 */
.modals-cancelss{position:absolute; z-index:1000; top:0; left: 0; right:0; bottom: 0; background-color: rgba(0,0,0,.5);}
.id-dialog-bodys{position: absolute;
z-index: 9997;
/* bottom: 40%; */
bottom: 28%;
left: 0;
right: 0;
/*padding-top: 24rpx;*/
border-radius: 10rpx ;
background-color: #fff;
box-sizing: border-box;
width: 70%;
margin: 0 auto;
}
/*动画前初始位置*/
.bottom-pos{-webkit-transform:translateY(100%);transform:translateY(100%);}
.id_yh_btn{
width:100%;
height:88rpx;
border-top: 2rpx solid rgba(229,229,229,1);
font-size:32rpx;
font-weight:800;
color:#121212;
text-align: center;
}
button{
background: none;
border: none;
border-radius: 0rpx;
}
button::after{
background: none;
border: none;
border-radius: 0rpx;
}
.id_text_top{
padding: 30rpx;
box-sizing: border-box;
font-size:30rpx;
font-weight:500;
color:#5a5959b9;
text-indent:2em;
}
.headimg{
height: 300rpx;
width: 100%;
}
.haed_bodys{
padding-top: 20rpx;
}
.haed_bodys .msgs{
color:#333C4C;
font-size: 32rpx;
text-align: center;
}
.haed_bodys .msgs .text{
color:#f64f15;
}
.butss{
font-size: 32rpx;
width:411rpx;
height:83rpx;
line-height: 83rpx;
text-align: center;
background:rgba(255,105,0,1);
border-radius:10rpx;
color:#FFFFFF;
margin: 0 auto;
margin-top: 50rpx;
margin-bottom: 30rpx;
}
\ No newline at end of file
const app = getApp();
var clientImgPath = app.globalData.clientImgPath;
Component({
/**
* 组件的属性列表
*/
properties: {
//人数
show:{
type:Boolean,
default:()=>{
return false
}
}
},
/**
* 组件的初始数据
*/
data: {
bottom:-200,
isShow:false,
clientImgPath:clientImgPath,
},
observers: {
show(e) {
this.setData({
isShow:e
})
if(this.data.isShow){
this.setData({
bottom:0,
})
}else{
this.sctcimg();
}
}
},
/**
* 组件的方法列表
*/
methods: {
touseThe(){
wx.navigateTo({
url:'/pages/personal/coupons/coupons'
})
},
sctcimg(){
this.setData({
bottom:-200,
})
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!-- 优惠券过期提醒 -->
<view class="ingdexhb" style="bottom:{{bottom}}rpx;transition:2s ease;">
<image src="{{clientImgPath}}/2020/index/group_img/MidAutumn/prompt.png" ></image>
<view class="ingdextext" bindtap="touseThe">
<text >您有优惠券即将过期,请尽快使用</text>
</view>
<view class="ingdexsc po_a" bindtap="sctcimg">
<image src='{{clientImgPath}}/images/images/sctc.png'></image>
</view>
</view>
/* components/promptPopup/promptPopup.wxss */
.ingdexhb{
width: 100%;
height: 100rpx;
padding: 0 24rpx;
box-sizing: border-box;
position: fixed;
left: 0;
}
.ingdextext{
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
line-height: 100rpx;
padding-left: 70rpx;
font-size: 30rpx;
}
.ingdexsc{
position: absolute;
width: 40rpx;
left: 40rpx;
top: -70rpx;
height: 70rpx;
}
\ No newline at end of file
// components/recommend/recommend.js
const app = getApp();
var img_host = app.globalData.ImgPath; //域名
var clientImgPath = app.globalData.clientImgPath;
Component({
/**
* 组件的属性列表
*/
properties: {
shop_list: {
type: Array,
value: []
}
},
/**
* 组件的初始数据
*/
data: {
img_host: img_host, //请求域名
clientImgPath:clientImgPath,
shop_list:[]
},
ready() { //组件中的周期函数
},
/**
* 组件的方法列表
*/
methods: {
// 跳转到商家店铺
jumpDd: function (e) {
let shop_id = e.currentTarget.dataset.shop_id
let is_ld = e.currentTarget.dataset.is_ld
let shop_type = e.currentTarget.dataset.shop_type
let hotel_id = e.currentTarget.dataset.hotel_id
if (shop_type == 'ele') {
wx.navigateTo({
url: '/pages/shop/shops/ele/ele?shop_id=' + shop_id,
})
} else if (shop_type == 'hotel') {
wx.navigateTo({
url: '/pages/shop/hotel/hotel_details/hotel_details?hotel_id=' + hotel_id,
})
} else {
wx.navigateTo({
url: '/pages/shop/shops/weidian/home_page_weidian/home_page_weidian?shop_id=' + shop_id,
})
}
},
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {
"Stars":"/components/Stars/Stars"
}
}
\ No newline at end of file
<wxs module="filter" src="../../utils/func.wxs"></wxs>
<view class=" w1005 mb20">
<view class="mt-20 heziboxz" wx:for="{{shop_list}}" wx:key="index" bindtap="jumpDd" data-is_ld="{{item.liandshangj}}"
data-shop_type="{{item.shop_type}}" data-shop_id="{{item.shop_id}}" data-hotel_id="{{item.hotel_id}}">
<view class="flex1">
<view class="flex1 jus-b ali-c mb-20">
<view class="fwb s30 flex1">{{item.shop_name}}</view>
<view
style="padding:0 8rpx;padding: 4rpx 14rpx;color: #b9d439;border:1px solid #b9d439;text-align: center;font-size:20rpx;z-index:20;border-radius:5rpx;"
wx:if="{{item.orderby != 100}}">
优选
</view>
<view class="s20 cf ml-15" wx:if="{{item.ysf_number!=0 }}"
style="padding: 4rpx 14rpx;width:100rpx;text-align:center;color:#f64f15;border-radius:5rpx;border:1px solid #f64f15;">
云闪付</view>
<view class="s20 cf ml-15" wx:if="{{item.onsell==1}}"
style="padding: 4rpx 14rpx;text-align:center;color:#f64f15;border-radius:5rpx;border:1px solid #f64f15;">
返红包</view>
<view class="s20 cf ml-15" wx:if="{{item.onsell==1}}"
style="padding: 4rpx 14rpx;width:80rpx;text-align:center;border-radius:5rpx;color: #ff9800;border: 1px solid #ff9800;">{{filter.filter(item.express_pay_proportion)}}</view>
</view>
</view>
<view class="flex acen jusb">
<view style="margin-top:-10rpx;" class="ali-c">
<Stars fen="{{item.star_score}}" />
<text class="sz_24 c_ff ml-10">{{item.star_score}}分</text>
</view>
<view class="s26 num" style="color:#6B6B6B;">
<text class=""> 销量{{item.month_num}}</text>
<!-- wx:if="{{item.ysf_number!=0}}" -->
<text class="wai" wx:if="{{(item.shop_code!=''|| item.run_code!='') && item.shop_type=='ele' }}">外</text>
<text class="dian">店</text>
</view>
<view class="s24 distance" style="color:#6C6C6C;margin-top:-4rpx">{{item.d}}</view>
</view>
<view class="flex acen jusb" style="padding-top:8rpx">
<view class="s24 ovd1" style="color:#6B6B6B;argin-top:8rpx;">{{item['addr']}}</view>
</view>
<view class="jus-b flex1 po_r mt-15">
<view class="jus-b flex1">
<image wx:for="{{item.imgs}}" wx:key='index' src="{{img_host}}/attachs/{{item}}"
style="width:32%;height:180rpx;border-radius: 6rpx;"></image>
</view>
</view>
</view>
</view>
\ No newline at end of file
@import "/style/out.wxss";
@import"/utils/css/public.wxss";
.heziboxz {
padding: 20rpx;
box-sizing: border-box;
background-color: #FFFFFF;
border-radius: 20rpx;
}
.num {
color: #6B6B6B;
margin-right: 50rpx;
margin-top: -6rpx;
display: flex;
justify-content: right;
line-height: 100%;
}
.wai {
background-color: tomato;
color: white;
border-radius: 6rpx;
margin: 0 6rpx;
font-size: 20rpx;
line-height: 26rpx;
height: 26rpx;
width: 24rpx;
text-align: center;
}
.dian {
color: white;
background-color: rgb(23, 139, 235);
border-radius: 6rpx;
margin: 0 6rpx;
font-size: 20rpx;
line-height: 26rpx;
height: 26rpx;
width: 24rpx;
text-align: center;
}
.distance {
width: 84rpx;
}
\ No newline at end of file
// components/shareEarnItem/shareEarnItem.js
const app = getApp();
var img_host = app.globalData.ImgPath;
var clientImgPath = app.globalData.clientImgPath;
Component({
/**
* 组件的属性列表
*/
properties: {
itemdata:{
type:Object,
default:{},
},
goods_id:{
type:Number|String,
default:"",
}
},
/**
* 组件的初始数据
*/
data: {
img_host,
clientImgPath,
},
/**
* 组件的方法列表
*/
methods: {
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--components/shareEarnItem/shareEarnitemdata.wxml-->
<!-- 分享赚钱的单个商品卡片 -->
<navigator url="/pages/shop/shops/weidian/weidian_details/weidian_details?goods_id={{goods_id}}&cate_id={{itemdata.cate_id}}" class="goodsfareitem" hover-class="none" >
<image class="img" src="{{img_host}}/attachs/{{itemdata.img}}" mode=""></image>
<view class="goodsfareitem_body">
<view class="faretit twoline">{{itemdata.title}}</view>
<view class="f_sales">已有{{itemdata.sold_num}}人购买</view>
<view class="fare_foot flex-wrap flex ali-c jus-b">
<view class="pricebox flex1">
<text class="Symbol">¥</text>
<text class="numbers">{{itemdata.disprice}}</text>
<!-- <text class="numbers">{{itemdata.miao == 0 ? itemdata.disprice:itemdata.miao}}</text> -->
</view>
<view class="comcard flex ali-c jus-c ml-10" wx:if="{{itemdata.commission!=0}}" >分享赚<text>{{itemdata.commission}}</text>元</view>
<view class="comcard flex ali-c jus-c ml-10" wx:else >分享好友</view>
</view>
</view>
</navigator>
/* components/shareEarnItem/shareEarnItem.wxss */
@import "/style/out.wxss";
@import"/utils/css/public.wxss";
.goodsfareitem {
width: 342rpx;
border-radius: 14rpx;
background-color: #FFFFFF;
margin-bottom: 24rpx; }
.goodsfareitem .img {
width: 342rpx;
height: 313rpx;
border-radius: 14rpx 14rpx 0px 0px; }
.goodsfareitem .goodsfareitem_body {
padding: 20rpx 12rpx; }
.goodsfareitem .goodsfareitem_body .faretit {
color: #000000;
height: 80rpx;
font-size: 30rpx; }
.goodsfareitem .goodsfareitem_body .f_sales {
color: #999999;
font-size: 22rpx;
padding-top: 12rpx;
padding-bottom: 20rpx; }
.goodsfareitem .goodsfareitem_body .fare_foot .pricebox {
color: #F64F15; }
.goodsfareitem .goodsfareitem_body .fare_foot .Symbol {
font-size: 24rpx; }
.goodsfareitem .goodsfareitem_body .fare_foot .numbers {
font-size: 30rpx;
font-weight: bold; }
.goodsfareitem .goodsfareitem_body .fare_foot .comcard text {
font-size: 26rpx;
padding: 0 5rpx 6rpx 5rpx; }
.goodsfareitem .goodsfareitem_body .fare_foot .comcard {
padding: 0 14rpx;
position: relative;
min-width: 157rpx;
height: 40rpx;
background-color: #F8B849;
font-size: 20rpx;
color: #fff;
border-radius: 4rpx;
box-sizing: border-box;
}
.goodsfareitem .goodsfareitem_body .fare_foot .comcard1 {
background-color: #FC4456; }
.goodsfareitem .goodsfareitem_body .fare_foot .comcard::before, .goodsfareitem .goodsfareitem_body .fare_foot .comcard::after {
content: "";
width: 24rpx;
height: 24rpx;
border-radius: 50%;
position: absolute;
z-index: 10;
background-color: #fff; }
.goodsfareitem .goodsfareitem_body .fare_foot .comcard::before {
left: -12rpx; }
.goodsfareitem .goodsfareitem_body .fare_foot .comcard:after {
right: -12rpx; }
\ No newline at end of file
Component({
/**
* 组件的属性列表
*/
properties: {
spec: {
type: Array,
value: []
},
spec_checked_id:{
type:Array,
value:[]
}
},
/**
* 组件的初始数据
*/
data: {
spec:[],
spec_checked_id:[]
},
/**
* 组件的方法列表
*/
methods: {
guige: function (e) {
this.setData({
gid: e.currentTarget.dataset.index,
gindex: e.currentTarget.dataset.current,
})
this.changedata();
},
changedata(){
if (this.data.guige[this.data.gindex].name){
this.triggerEvent("changeda", { name1: this.data.guige[this.data.gindex].name});
}
if (this.data.color[this.data.cindex].name){
this.triggerEvent("changeda", { name2: this.data.color[this.data.cindex].name });
}
}
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view wx:for="{{spec}}" wx:for-item="item" wx:for-index="index">
<view class="bt_min" bindtap="a">{{item.name}}</view>
<view class='dis'>
<block wx:for="{{item.specInfo}}" wx:for-index="ind" wx:for-item="it">
<view class="{{spec_checked_id[index] == it.id ? 'color':'colorbt'}}" bindtap='guige' data-index='{{item.id}}' data-current='{{index}}'>{{it.item}}</view>
</block>
</view>
</view>
<!-- <view>{{guige[gindex].name}}:{{color[cindex].name}}</view> -->
/* zujian/guigeshaixuan.wxss */
.color{
width:146rpx;
height:56rpx;
background:rgba(255,105,0,1);
border-radius:3rpx;
font-size:28rpx;
font-weight:500;
color:rgba(255,255,255,1);
line-height:56rpx;
text-align: centerl;
margin-bottom: 30rpx;
}
.colorbt{
width:146rpx;
height:56rpx;
background:rgba(241,243,238,1);
border-radius:3rpx;
font-size:28rpx;
font-weight:500;
color:#1A1A1A;
line-height:56rpx;
text-align: center;
margin-bottom: 30rpx;
}
.dis{display: flex;justify-content: space-between;flex-wrap:wrap;}
.bt_min{
font-size:28rpx;
font-weight:500;
color:rgba(26,26,26,1);
margin-bottom: 40rpx;
}
\ No newline at end of file
// components/susuccerpup/susuccerpup.js
const app = getApp();
var clientImgPath = app.globalData.clientImgPath;
Component({
/**
* 组件的属性列表
*/
properties: {
twotit:{
type:String,
default:"请耐心等待",
},
isback:{
type:Boolean,
default:false,
}
},
/**
* 组件的初始数据
*/
data: {
showtip:false,
clientImgPath,
},
/**
* 组件的方法列表
*/
methods: {
cancel(type) {//关闭
this.setData({
showtip:false,
})
if(this.data.isback){
wx.navigateBack({
})
}
},
//提示弹窗
change(e) {
this.setData({
showtip:false,
})
},
show(){
this.setData({
showtip:true,
})
},
}
})
{
"component": true,
"usingComponents": {
"van-popup": "/@vant/weapp/lib/popup/index"
}
}
\ No newline at end of file
<!--components/susuccerpup/susuccerpup.wxml-->
<!-- 信息提交成功的弹窗 -->
<view class="susuccerpup">
<van-popup show="{{showtip}}" position="center" bind:close="cancel">
<view class="susuccerpup_body">
<image class="icons" src="{{clientImgPath}}/images/pupicons.png" mode=""></image>
<view class="onestit">资料提交成功</view>
<view class="twotit">{{twotit}}</view>
<view class="pupbutton" bindtap="cancel" >我知道了</view>
</view>
</van-popup>
</view>
/* components/susuccerpup/susuccerpup.wxss */
.susuccerpup_body{
height: 475rpx;
width: 400rpx;
border-radius: 14rpx;
background-color: #fff;
text-align: center;
}
.susuccerpup_body .icons{
width: 235rpx;
height: 204rpx;
margin: 0 auto;
margin-top: -28rpx;
}
.susuccerpup_body .onestit{
color: #333333;
font-size: 32rpx;
text-align: center;
}
.susuccerpup_body .twotit{
color: #999999;
font-size: 28rpx;
text-align: center;
margin-top: 8rpx;
}
.susuccerpup_body .pupbutton{
width: 240rpx;
height: 78rpx;
line-height: 78rpx;
text-align: center;
background: #FF5028;
box-shadow: 0px 20rpx 30rpx 0px rgba(255, 80, 40, 0.2);
border-radius: 39rpx;
color: #FFFFFF;
font-size: 32rpx;
margin: 0 auto;
margin-top: 48rpx;
}
\ No newline at end of file
// components/topuppup/topuppup.js
const app = getApp();
var clientImgPath = app.globalData.clientImgPath;
Component({
/**
* 组件的属性列表
*/
properties: {
showtip:{
type:Boolean,
default:true,
},
coupon_money:{
type:String|Number,
}
},
/**
* 组件的初始数据
*/
data: {
clientImgPath,
},
/**
* 组件的方法列表
*/
methods: {
show(){
this.setData({
showtip:true,
})
},
//关闭
cancel(){
this.triggerEvent("clearpup", { });//关闭
}
}
})
{
"component": true,
"usingComponents": {
"van-popup": "/@vant/weapp/lib/popup/index"
}
}
\ No newline at end of file
<!--components/topuppup/topuppup.wxml-->
<view class="topuppup">
<van-popup show="{{showtip}}" position="center" bind:close="cancel">
<view class="tipboxs1">
<image class="bgimgs" src="{{clientImgPath}}/images/gasstation/popupimg.png" mode=""></image>
<view class="discountinfo">
<view class="infostit">恭喜您获得</view>
<view class="youhuitest">鹿马<text class="prices">{{coupon_money}}</text>元加油优惠券</view>
<view class="youhuitest">下载鹿马108APP即可享受优惠加油</view>
</view>
<view class="clearsbtn" bindtap="cancel">
<image class="imgds" src="{{clientImgPath}}/images/gasstation/buttons.png" mode=""></image>
</view>
</view>
</van-popup>
</view>
\ No newline at end of file
.topuppup {
/* width: 726rpx; */
}
.tipboxs1 {
position: relative;
}
.tipboxs1 .bgimgs {
width: 726rpx;
height: 530rpx;
}
.tipboxs1 .Closeicon {
position: absolute;
left: 50%;
margin-left: -30rpx;
margin-top: 40rpx;
width: 60rpx;
height: 60rpx;
}
.tipboxs1 .clearsbtn {
text-align: center;
}
.tipboxs1 .clearsbtn .imgds {
width: 409rpx;
height: 89rpx;
margin: 0 auto;
}
.tipboxs1 .discountinfo {
position: absolute;
left: 0;
top: 0;
width: 100%;
padding-top: 200rpx;
box-sizing: border-box;
}
.tipboxs1 .discountinfo .infostit {
color: #C09E77;
font-size: 36rpx;
text-align: center;
}
.tipboxs1 .discountinfo .youhuitest {
color: #C09E77;
font-size: 30rpx;
text-align: center;
margin-top: 6rpx;
}
.tipboxs1 .discountinfo .youhuitest .prices {
font-size: 60rpx;
font-weight: bold;
}
// components/count-down/count-down.js
Component({
/**
* 组件的属性列表
*/
properties: {
showDay: {
type: Boolean,
default: true
},
showColon: {
type: Boolean,
default: true
},
backgroundColor: {
type: String,
default: "#35374D"
},
borderColor: {
type: String,
default: "#35374D"
},
color: {
type: String,
value: "#fff"
},
splitorColor: {
type: String,
default: "#35374D"
},
day: {
type: Number,
default: 0
},
hour: {
type: Number,
default: 0
},
minute: {
type: Number,
default: 0
},
seconds: {
type: Number,
default: 0
},
Countdowns: {
type: Number,
default: 0
}
},
attached: function () {
if (this.properties.initDuration === 0) {
this.setEndContent(this.properties.endContent)
}
},
/**
* 组件的初始数据
*/
data: {
timer: null,
d: '00',
h: '00',
i: '00',
s: '00',
leftTime: 0,
seconds: 0
},
// watch: {
// second (val) {
// console.info(111111111)
// this.seconds = this.toSeconds(this.day, this.hour, this.minute, this.second)
// this.startData();
// }
// },
created: function() {
setTimeout(()=>{
this.startData();
},1000)
},
beforeDestroy() {
clearInterval(this.timer)
},
/**
* 组件的方法列表
*/
methods: {
toSeconds(day, hours, minutes, seconds) {
return (day * 60 * 60 * 24) + (hours * 60 * 60) + (minutes * 60) + seconds
},
timeUp() {
clearInterval(this.data.timer)
// console.info('结束了')
// this.$emit('timeup')
this.triggerEvent('timeups')
// this.startData()
},
startData(){
this.seconds = this.toSeconds(this.day, this.hour, this.minute, this.second)
console.info( this.data.seconds,111111111)
// console.info(this.seconds)
if(this.seconds<=0){
return
}
clearInterval(this.data.timer)
this.countDown()
// console.info(this.timer,'zz')
this.data.timer = setInterval(() => {
this.data.seconds--
if (this.data.seconds < 0) {
this.timeUp()
return
}
this.countDown()
}, 1000)
},
countDown() {
let seconds = this.data.seconds
let [day, hour, minute, second] = [0, 0, 0, 0]
if (seconds > 0) {
day = Math.floor(seconds / (60 * 60 * 24))
hour = Math.floor(seconds / (60 * 60)) - (day * 24)
minute = Math.floor(seconds / 60) - (day * 24 * 60) - (hour * 60)
second = Math.floor(seconds) - (day * 24 * 60 * 60) - (hour * 60 * 60) - (minute * 60)
} else {
this.timeUp()
}
if (day < 10) {
day = '0' + day
}
if (hour < 10) {
hour = '0' + hour
}
if (minute < 10) {
minute = '0' + minute
}
if (second < 10) {
second = '0' + second
}
this.setData({
d :day,
h : hour,
i : minute,
s : second
})
// console.info(this.s)
}
}
})
\ No newline at end of file
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<view class="uni-countdown">
<view wx:if="{{!showColon}}" class="{{Countdowns==1?'uni-countdown__numbers':'uni-countdown__number'}}" style="borderColor:{{borderColor}};color:{{color}}; background:{{backgroundColor}}">{{d}}</view>
<view wx:if="showDay" class="uni-countdown__splitor" style="color:{{splitorColor}}">{{showColon ? '' : '天'}}</view>
<view class="{{Countdowns==1?'uni-countdown__numbers':'uni-countdown__number'}}" style="borderColor:{{borderColor}};color:{{color}}; background:{{backgroundColor}}">{{h}}</view>
<view class="uni-countdown__splitor" style="color:{{splitorColor}}">{{showColon ? ':' : '时'}}</view>
<view class="{{Countdowns==1?'uni-countdown__numbers':'uni-countdown__number'}}" style="borderColor:{{borderColor}};color:{{color}}; background:{{backgroundColor}}">{{i}}</view>
<view class="uni-countdown__splitor" style="color:{{splitorColor}}">{{showColon ? ':' : '分'}}</view>
<view class="{{Countdowns==1?'uni-countdown__numbers':'uni-countdown__number'}}" style="borderColor:{{borderColor}};color:{{color}}; background:{{backgroundColor}}">{{s}}</view>
<view wx:if="!showColon" class="uni-countdown__splitor" style="color:{{splitorColor}}">{{showColon ? '' : '秒'}}</view>
</view>
\ No newline at end of file
/* components/uni-countdowns/uni-countdowns.wxss */
.uni-countdown {
padding: 2rpx 0;
display: inline-flex;
flex-wrap: nowrap;
justify-content: center
}
.uni-countdown__splitor {
justify-content: center;
line-height: 30rpx;
padding: 0 5rpx;
font-size: 22rpx;
}
.uni-countdown__number {
/* line-height: 30rpx; */
justify-content: center;
/* height: 30rpx; */
margin: 0 5rpx;
border: 0;
font-size: 22rpx;
padding: 2rpx 4rpx;
}
.uni-countdown__numbers {
/* line-height: 30rpx; */
justify-content: center;
/* height: 30rpx; */
margin: 0 5rpx;
border: 0;
font-size: 20rpx;
padding: 3rpx 8rpx;
}
\ No newline at end of file
// components/upload_pictures/upload_pictures.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
images: []
},
/**
* 组件的方法列表
*/
methods: {
chooseImage(e) {
wx.chooseImage({
sizeType: ['original', 'compressed'], //可选择原图或压缩后的图片
sourceType: ['album', 'camera'], //可选择性开放访问相册、相机
success: res => {
const images = this.data.images.concat(res.tempFilePaths)
// 限制最多只能留下3张照片
const images1 = images.length <= 3 ? images : images.slice(0, 3)
this.setData({
images: images1
})
}
})
},
removeImage(e) {
var that = this;
var images = that.data.images;
// 获取要删除的第几张图片的下标
const idx = e.currentTarget.dataset.idx
// splice 第一个参数是下表值 第二个参数是删除的数量
images.splice(idx, 1)
this.setData({
images: images
})
},
handleImagePreview(e) {
const idx = e.target.dataset.idx
const images = this.data.images
wx.previewImage({
current: images[idx], //当前预览的图片
urls: images, //所有要预览的图片
})
},
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
<!--components/upload_pictures/upload_pictures.wxml-->
<view class="question-images clearFloat">
<block wx:for="{{images}}" wx:key="*this">
<view class="q-image-wrap">
<!-- 图片缩略图 -->
<image class="q-image" src="{{item}}" mode="aspectFill" data-idx="{{index}}" bindtap="handleImagePreview"></image>
<!-- 移除图片的按钮 -->
<view class="q-image-remover" data-idx="{{index}}" bindtap="removeImage">
<view class="shancimg">
<image src="/images/shanchu.png"></image>
</view>
</view>
</view>
</block>
<view class='uploadImgBtn' bindtap="chooseImage" wx:if="{{images.length < 3}}">
<image src="/images/zhaopian.png"></image>
</view>
</view>
\ No newline at end of file
/* components/upload_pictures/upload_pictures.wxss */
.q-image-wrap{
width: 150rpx;
height: 150rpx;
float: left;
margin-right: 20rpx;
border: 1px solid rgb(236, 233, 233);
position: relative;
}
.q-image{
width: 100%;
height: 100%;
display: block
}
.q-image-remover{
position: absolute;
top: 0;
right: 5rpx;
}
.q-image-remover icon{
position: absolute;
left:12rpx;
bottom:12rpx;
color:#fff;
}
.uploadImgBtn{
width: 150rpx;
height: 150rpx;
text-align: center;
line-height: 140rpx;
float: left;
}
.uploadImgBtn icon{
font-size: 80rpx;
color: #999;
}
image{
width: 100%;
height: 100%;
display: block;
}
.shancimg{
width: 30rpx;
height: 30rpx;
background: #fff;
border-radius: 50%;
}
\ No newline at end of file
var app = getApp();
import { addrList, deleteAddr,setDefaultAddr } from "../../api/basicInformation.js";
Page({
/**
* 页面的初始数据
*/
data: {
addr_list : [],
clientImgPath: app.globalData.clientImgPath,
type:'0', //0普通进入 1外卖地址进入 2商城地址进入
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.init();
},
init(){
addrList({type:this.data.type}).then(res=>{
this.setData({
addr_list : res.data
})
})
},
addNewAddr(){
wx.navigateTo({
url: '/pages/new_address/new_address?type='+this.data.type,
})
},
change(e){
let items=e.currentTarget.dataset.items;
wx.navigateTo({
url: '/pages/new_address/new_address?isedit=' + JSON.stringify(items)
})
},
deleteAddr(e){
var that = this
wx.showModal({
title: '提示',
content: '确认删除?',
confirmText: '确认',
showCancel: true,
success: function (res) {
if (res.confirm) {
var data = {
addr_id: e.currentTarget.dataset.id
}
deleteAddr(data).then(res => {
if (res.code == 0) {
/*wx.showModal({
title: '提示',
content: '删除成功',
confirmText: '确认',
showCancel: false,
success:function(res){
that.init();
}
})
*/
that.init();
} else {
wx.showModal({
title: '提示',
content: res.msg,
})
}
})
}
}
})
},
//设置默认地址
setDefaultAddr(e){
console.log(e)
let index=e.target.dataset.index;//点击的下标
let addr_id=e.detail.value[0];//点击的地址id
let type=e.target.dataset.type;//点击的地址类型
let addr_list=this.data.addr_list;
console.log(index,addr_id,type,addr_list)
setDefaultAddr({
addr_id:addr_id,
type:type
}).then(res=>{
wx.showToast({
title: res.data,
icon: 'none'
})
if(res.code==0){
addr_list.map((item,index)=>{
if(item.type==type){
if(item.addr_id==addr_id){
item.is_default=1;
}else{
item.is_default=0;
}
}
})
this.setData({addr_list});
}
}).catch(err=>{
wx.showToast({
title: err. data,
icon: 'none'
})
})
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "我的收货地址"
}
\ No newline at end of file
<view class="boxs">
<view wx:for='{{addr_list}}' wx:key="index" wx:for-item="item">
<checkbox-group bindchange='setDefaultAddr' data-type="{{item.type}}" data-index="{{index}}">
<view class="bobox ov">
<view class="beijing posr">
<view class="sz_30 c_bi twb">{{item.name}} <text>{{item.mobile}} </text></view>
<view class="sz_30 c_bi mt-10" >{{item.addr}}</view>
<image wx:if="{{item.type==2}}" class="posa" src="{{clientImgPath}}/images/images/sc.png"></image>
<image wx:if="{{item.type==1}}" class="posa" src="{{clientImgPath}}/images/images/wm.png"></image>
</view>
<view class="dibubox ali-z">
<view class="ali-c">
<checkbox
disabled="{{item.is_default==1}}"
checked="{{item.is_default==1}}"
value="{{item.addr_id}}"
class="mb-10"
/>
<view class="sz_30 bt_hei ml-20">设为默认地址</view>
</view>
<view class="ali-c">
<view bindtap="change" data-items="{{item}}">
<view class="btnxiao"> 修改</view>
</view>
<view data-id="{{item.addr_id}}" class="btnxiao ml-30" bindtap="deleteAddr">删除</view>
</view>
</view>
</view>
</checkbox-group>
</view>
<button class="button_a flexc mt-60" bindtap="addNewAddr">
<view class="bttimg"><image src="{{clientImgPath}}/images/uts/jiayige.png"></image></view>
<view class="ml-30">添加新地址</view>
</button>
</view>
/* pages/personal//set/address_list/address_list.wxss */
page{
background: rgba(245, 242, 242, 1);
}
.bobox{
width:100%;
background:rgba(255,255,255,1);
border-radius:10rpx;
margin-bottom: 20rpx;
}
.beijing{
width:100%;
background:linear-gradient(90deg,rgba(255,105,0,1),rgba(254,144,67,1));
padding: 20rpx 20rpx;
box-sizing: border-box;
}
.beijing>image{
width:100rpx;height:100rpx;right: 0;top: 0;
}
.dibubox{
padding: 30rpx 20rpx;
box-sizing: border-box;
}
.btnxiao{
padding: 5rpx 20rpx;
box-sizing: border-box;
border:2rpx solid #f64f15;
border-radius:10rpx;
font-size:30rpx;
font-weight:500;
color:#f64f15;
}
.bttimg{
width: 46rpx;
height: 46rpx;
}
\ No newline at end of file
...@@ -75,7 +75,7 @@ Page({ ...@@ -75,7 +75,7 @@ Page({
showtis:false, showtis:false,
}) })
wx.navigateTo({ wx.navigateTo({
url: '/pages/shop/order/weidianorder/weidianLine_list_user/weidianLine_list_user?currentTab=1&status=1,2', url: '/pages/order/order?currentTab=1&status=1,2',
}) })
}, },
//参团列表 //参团列表
......
...@@ -112,7 +112,7 @@ ...@@ -112,7 +112,7 @@
<view class="navnames">购买记录</view> <view class="navnames">购买记录</view>
</navigator> </navigator>
<navigator url="/pages/personal/set/address_list/address_list?type=0" class="navitem" style="margin-top: 57rpx;" hover-class="none"> <navigator url="/pages/address_list/address_list?type=0" class="navitem" style="margin-top: 57rpx;" hover-class="none">
<image class="imgiocn imgiocn8" src="{{clientImgPath}}/images/lmping/addressicon.png" mode=""></image> <image class="imgiocn imgiocn8" src="{{clientImgPath}}/images/lmping/addressicon.png" mode=""></image>
<view class="navnames">收货地址</view> <view class="navnames">收货地址</view>
</navigator> </navigator>
......
import { addAddress, getUserAddr,getAddressList } from "../../api/basicInformation.js";
var app = getApp();
var clientImgPath = app.globalData.clientImgPath;
var img_host = app.globalData.ImgPath;
import Util from '../../utils/util.js';
var QQMapWX = require('../../utils/libs/qqmap-wx-jssdk.min.js');
var qqmapsdk = new QQMapWX({
key: 'CK6BZ-BTHCW-4IPRC-OZLAN-ZTITF-Y3FHA'
});
Page({
/**
* 页面的初始数据
*/
data: {
clientImgPath: app.globalData.clientImgPath,
check: true,
is_edit: 0,
is_default: 0,
radioItems: [ //单选框
{name: '1',value: '外卖',checked: false},
{name: '2',value: '商城',checked: true}
],
type:0,//0普通进入 1外卖地址进入 2商城订单进入
array:[[],[],[]],//省市区
pickerValue:[0,0,0],//选中的下标
manageType:1,//1添加 2修改
addressData: {
addr_id:'', //地址id (修改地址时才有)
name:'', //名字
mobile:'', //电话
addr:'',//省市区
doorplate:'',//详细地址
province:'',//省id
citys:'', //城市id
countys:'', //区id
lng:'',
lat:'',
is_default:'0', //0不是默认地址 1默认
type:2,//1外卖 2商城
},
type:0, //0普通进入 1外卖地址进入 2商城地址进入
},
bindinput(e){
let value=e.detail.value;
let type=e.target.dataset.type;
let addressData=this.data.addressData;
if(type==1){
addressData.name=value; //名字
}else if(type==2){
addressData.mobile=value; //电话
}else{
addressData.doorplate=value; //详细地址
}
console.log(addressData)
this.setData({addressData});
},
bindPickerChange(e){ //选择省市区 点击确定
let trueAddr='',
value=e.detail.value,//选中的下标
num=0,
array=this.data.array,
addressData=this.data.addressData;
for( let i=0;i<value.length;i++){
if(value[i]==0){
break;
}else{
num++;
if(num==value.length){
array.map((item,index)=>{
trueAddr=trueAddr+''+item[value[index]].name;
})
}
}
}
addressData.trueAddr=trueAddr;
this.setData({ addressData });
},
columnchange(e){ //选择某个地区
let array=this.data.array;//省市区 数组
let column=e.detail.column; //0省 1市 2区
let index=e.detail.value; //下标
let obj=array[column][index];
let pickerValue=this.data.pickerValue;//选择得下标
pickerValue[column]=index;//选中的这项下标添加进去
if(column==0){
if(index!=0){
if(array[1].length!=0){
array[1]=array[2]=[];
pickerValue[1]=pickerValue[2]=0;
}
this.getAddressList(obj.pid,column);
}else{
array[1]=array[2]=[];
}
}else{
if(column!=2){
if(index==0){
array[2]=[];
}else{
this.getAddressList(obj.pid,column)
}
}
}
this.setData({ array,pickerValue });
},
radioChange(e){ //点击单选框
let radioItems=this.data.radioItems;
radioItems.map(item=>{
if(item.name==e.detail.value){
item.checked=true;
}else{
item.checked=false;
}
})
this.setData({ radioItems });
},
openMap: function () {
var that = this;
let addressData=this.data.addressData;
wx.chooseLocation({
success:(res)=> {
// addressData.lat=addressData.lat1=res.latitude;
// addressData.lng=addressData.lng1=res.longitude;
addressData.lat=res.latitude;
addressData.lng=res.longitude
addressData.doorplate=res.address+res.name;//详细地址
console.log(res.latitude,res.longitude,res)
that.setData({
addressData
})
qqmapsdk.reverseGeocoder({
location: {
latitude: res.latitude,
longitude: res.longitude
},
success: function (data) {
let res=data.result;
addressData.trueAddr=res.address_component.province+res.address_component.city+res.address_component.district;//省市区
addressData.province=Number(res.ad_info.adcode)-Number(res.ad_info.adcode)%1000;//省ID
addressData.citys=Number(res.ad_info.adcode)-Number(res.ad_info.adcode)%100;//市ID
addressData.countys=Number(res.ad_info.adcode);//区县ID
that.setData({
addressData
})
console.log(addressData)
}
})
}
})
},
// 点击切换
clickTab (e) {
console.log(e)
var addressData = this.data.addressData;
addressData.is_default=e.currentTarget.dataset.current;
this.setData({
addressData
})
},
Submit() {
let addressData=this.data.addressData;//全部参数
let array=this.data.array;//地址
console.log(this.data.addressData)
if(!addressData.name){
wx.showToast({title: '请填写收货人姓名', icon: 'none'});
return;
}
if(!/(^1[3|4|5|7|8|9][0-9]{9}$)/.test(addressData.mobile)){
wx.showToast({title: '请输入正确的手机号码', icon: 'none'});
return;
}
if(!addressData.trueAddr){
wx.showToast({title: '请选择所在地址', icon: 'none'});
return;
}
if(!addressData.doorplate){
wx.showToast({title: '请输入详细收获地址', icon: 'none'});
return;
}
if(this.data.manageType==1){ //添加收获地址
this.data.radioItems.map((item,index)=>{ //外卖地址 还是 商城地址
if(item.checked){
addressData.type=index+1;
}
})
if(addressData.type==2){ //商城地址才有pid
addressData.province=array[0][this.data.pickerValue[0]].pid;//省id
addressData.citys=array[1][this.data.pickerValue[1]].pid;//城市id
addressData.countys=array[2][this.data.pickerValue[2]].pid; //区id
addressData.lat='';
addressData.lng='';
}
}else{
if(addressData.type==2){ //商城地址才有pid
addressData.lat='';
addressData.lng='';
}
}
this.setData({addressData});
console.info(addressData,'fdfdf')
addAddress({
addr_id: addressData.addr_id,
name: addressData.name,
mobile: addressData.mobile,
is_default:addressData.is_default,
trueAddr: addressData.trueAddr,
doorplate: addressData.doorplate,
type: addressData.type,
province: addressData.province,
citys: addressData.citys,
countys: addressData.countys,
lat1: addressData.lat,
lng1: addressData.lng,
// lat: '11111', //字段作废
// lng: '22222', //字段作废
}).then(res => {
let pages = getCurrentPages()
if (pages.length > 2) {
let prevpage = pages[pages.length - 2]
prevpage.setData({
addr_user_id: res.data.addr_id || 0,
addr_id: res.data.addr_id || 0,
})
}
if (res.code == 0) {
wx.navigateBack({
delta: 1,
})
} else {
wx.showToast({
title: res.msg,
icon: 'none'
})
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(option) {
let radioItems=this.data.radioItems;
let manageType=0;
if(option.type!='0'){
radioItems.map(item=>{
item.checked=false;
});
}
if(option.isedit){ //编辑 修改 进来
let addressData = JSON.parse(option.isedit);
manageType=2;
radioItems[addressData.type-1].checked=true;
if(addressData.type==2){
addressData.lat='';
addressData.lng='';
}
console.log(addressData,'zheli')
this.setData({addressData});
}else{ //添加地址进来
manageType=1;
if(option.type!=0){
radioItems[option.type-1].checked=true;
}
}
this.setData({type:option.type,radioItems,manageType});
this.getAddressList();//省市区
},
getAddressList(pid,column){ //省市区
wx.showLoading({title:'请稍后...'});
let obj={pid:0,ParentId:0,name:'请选择'};
let array=this.data.array;
getAddressList({
pid:pid?pid:''
}).then(res=>{
if(res.code==0){
wx.hideLoading();
res.data.unshift(obj);
if(pid){ //一开始请求省
if(column==0){ //选则了省 请求出了市的数据
array[1]=res.data;
}else if(column==1){ //选则了市 请求出了区的数据
array[2]=res.data;
}
}else{
array[0]=res.data;
}
this.setData({array});
}
})
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "添加新地址"
}
\ No newline at end of file
<view class="boxs">
<form >
<view class="topboxss">
<view class="ali-z">
<view class="flex1">
<view class="lieboxs ali-c">
<view class="biqim">收货人</view>
<view class="inptbox">
<input
value="{{addressData.name}}"
name='name'
placeholder="请填写收货人姓名"
placeholder-class="sz_30 inp_hui"
bindinput="bindinput"
data-type="1"
>
</input>
</view>
</view>
<view class="xian"></view>
<view class="lieboxs ali-c">
<view class="biqim">手机号码</view>
<view class="inptbox">
<input
value="{{addressData.mobile}}"
name='mobile'
placeholder="请填写手机号码"
placeholder-class="sz_30 inp_hui"
bindinput="bindinput"
data-type="2"
>
</input>
</view>
</view>
<view class="xian"></view>
<view class="lieboxs ali-c">
<view class="biqim">地址类型</view>
<radio-group class="inptbox ali-c" bindchange="radioChange" >
<label class="ali-c mr-20" wx:for="{{radioItems}}" wx:key="index">
<radio
color="#F54F15"
style="transform:scale(0.7)"
id="{{item.name}}"
value="{{item.name}}"
checked="{{item.checked}}"
disabled='{{manageType==2}}'
>
</radio>
<label class="label-2-text" for="{{item.name}}">
<text class="s30" style="color:{{item.checked?'#F54F15':''}}">{{item.value}}</text>
</label>
</label>
</radio-group>
</view>
</view>
</view>
<view class="xian"></view>
<!-- 外卖地址 -->
<view class="lieboxs ali-z" bindtap="openMap" wx:if="{{radioItems[0].checked}}">
<view class="biqim">所在地址</view>
<view class="inptboxsd sz_30 bt_hei">
<input
class="pr-20"
disabled="true"
value='{{addressData.trueAddr}}'
name='address_component'
placeholder="请选择所在地址"
placeholder-class="sz_30 inp_hui"
>
</input>
</view>
<view class="dingwimg" wx:if="{{check}}">
<image src="{{clientImgPath}}/images/wm/dizhi@2x.png" style="width:28rpx;height:42rpx"></image>
</view>
</view>
<!-- 商城地址-->
<picker
mode ='multiSelector'
class="lieboxs"
wx:if="{{radioItems[1].checked}}"
value="{{pickerValue}}"
range="{{array}}"
bindchange="bindPickerChange"
bindcolumnchange="columnchange"
wx:if="{{radioItems[1].checked}}"
range-key="name"
>
<view class="ali-c" style="height:100rpx">
<view class="biqim">所在地区</view>
<view class="inptbox">
<input
name='doorplate'
disabled="true"
value="{{addressData.trueAddr}}"
placeholder="请选择所在区域"
placeholder-class="sz_30 inp_hui"
>
</input>
</view>
<image src="{{clientImgPath}}/images/images/storeicons3.png" style="width:18rpx;" mode="widthFix"></image>
</view>
</picker>
<view class="xian"></view>
<view class="lieboxs ali-c">
<view class="biqim">详细地址</view>
<view class="inptbox">
<input
name='doorplate'
value="{{addressData.doorplate}}"
placeholder="如:道路、门牌号、小区、楼栋号、单元等"
placeholder-class="sz_30 inp_hui"
bindinput="bindinput"
data-type="3"
>
</input>
</view>
</view>
<view class="xian mb-20"></view>
<view class="ali-z pb-20">
<view class="sz_30 bt_hei">设置为默认地址</view>
<view class="ali-c btnbox ov">
<view class="{{addressData.is_default==0?'btnbox_zi1':'btnbox_zis1'}}" data-current="0" bindtap="clickTab"></view>
<view class="{{addressData.is_default==1?'btnbox_zi':'btnbox_zis'}}" data-current="1" bindtap="clickTab"></view>
</view>
</view>
</view>
<button class="button mt-60" hover-class="button-hover" type='primary' bindtap="Submit">保存并使用</button>
</form>
</view>
\ No newline at end of file
/* pages/personal//set/new_address/new_address.wxss */
page{
background: rgba(245, 242, 242, 1);
}
/* */
.lieboxs{
width: 100%;
height: 100rpx;
}
.biqim{
width: 150rpx;
font-size:30rpx;
font-weight:500;
color:rgba(0,0,0,1);
}
.inptbox{
flex: 1;
height: 50rpx;
font-size:30rpx;
font-weight:500;
color:rgba(0,0,0,1);
}
.inptbox input{
flex: 1;
height: 100%;
}
.getMsgBtn{
background:rgba(255,105,0,1);
border-radius:5rpx;
padding:10rpx 20rpx ;
box-sizing: border-box;
font-size:30rpx;
font-weight:500;
color:rgba(255,255,255,1);
}
.grayColor{
background: #FEC59C;
border-radius:5rpx;
padding:10rpx 20rpx ;
box-sizing: border-box;
font-size:30rpx;
font-weight:500;
color:rgba(255,255,255,1);
}
.dhuaimg{
width: 53rpx ;height:64rpx;
margin: 0 auto;
}
.dhuabox{
width: 180rpx;
height: 200rpx;
padding-top: 60rpx;
box-sizing: border-box;
border-left: 1px solid rgba(220, 220, 220,.3);
}
.btnbox{
border:1px solid #f64f15;
border-radius:5rpx;
}
.btnbox_zi{
width:70rpx;
height:56rpx;
background: #f64f15;
}
.btnbox_zis{
width:70rpx;
height:36rpx;
}
.btnbox_zi1{
width:70rpx;
height:56rpx;
background: #FEC59C;
}
.btnbox_zis1{
width:70rpx;
height:56rpx;
}
.xiangyouimg{
width:13rpx;
height:24rpx;
}
.dingwimg{
width: 30rpx;
height: 50rpx;
}
.inpudz{
width: 450rpx;
}
.inptboxsd{
flex: 1;height: 100rpx;
}
.inptboxsd input{
flex: 1;height: 100rpx;
}
.inp_hui{
font-size: 26rpx !important;
color: rgb(170, 170, 170) !important;
}
\ No newline at end of file
const app = getApp()
import {
orderStatus,
orderList,
requestOrder,
eleOrdStatus,
eleOrdList,
requestEleOrder,
getRefundOrderList,
setRefundOrderCancel,
setReceivingGoods,
setRefundOrderDel,
} from '../../api/order.js';
import Utils from "../../utils/util.js";
import luma from "../../utils/luma.js";
import {
carryType,
ele_carry
} from "../../api/shopping"
var clientImgPath = app.globalData.clientImgPath;
var img_host = app.globalData.ImgPath;
var staticUrl = app.globalData.staticUrl
Page({
/**
* 页面的初始数据
*/
data: {
//商城定义变量
currentTab: 0,
order: [], //正常订单数据
refundOrder: [], //售后订单数据
pageNum: 1,
is_loading_done: false,
statusTab: 'all',
clientImgPath: clientImgPath,
img_host: img_host,
userInfo: {},
hasUserInfo: false,
currentTabs: 0,
navScrollLeft: 0,
checkClassValue: 1,
//外卖定义变量
elecurrentTab: 0,
eleorder: [],
elepageNum: 1,
eleis_loading_done: false,
elelist: [],
elebtList: [],
eleimg_host: img_host,
elepage: 1,
eleis_loading_done: false,
eleclientImgPath: clientImgPath,
showpop: false, // 买菜弹窗控制
ewmUrl: '', // 买菜弹窗二维码图片路径
staticUrl: staticUrl,
//卖菜定义变量
carrycurrentTab: 0,
carryorder: [],
carrypageNum: 1,
carryis_loading_done: false,
carrylist: [],
carrybtList: [],
carryimg_host: img_host,
carrypage: 1,
carryis_loading_done: false,
carryclientImgPath: clientImgPath,
showpop: false, // 买菜弹窗控制
ewmUrl: '', // 买菜弹窗二维码图片路径
staticUrl: staticUrl,
collection_time: '', //买菜提货时间
isshowshoping: false, //是否显示买菜模块 默认不显示
},
// 获取滚动条当前位置
onPageScroll(e) {
wx.setStorageSync('scrollTop', e.scrollTop);
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.setStorageSync('isDelorder', ''); //清除方法
wx.getSystemInfo({
success: (res) => {
this.setData({
pixelRatio: res.pixelRatio,
windowHeight: res.windowHeight,
windowWidth: res.windowWidth,
elepixelRatio: res.pixelRatio,
elewindowHeight: res.windowHeight,
elewindowWidth: res.windowWidth
})
},
})
this.setData({
//商城数据
statusTab: options.current ? options.current : "all", // 订单状态
status: options.status ? options.status : "all",
is_dianping: options.is_dianping ? options.is_dianping : 0,
currentTab: options.currentTab ? options.currentTab : 0,
//外卖数据
elestatusTab: options.current ? options.current : "all", // 订单状态
elestatus: "all",
eleis_dianping: options.is_dianping ? options.is_dianping : 0,
elecurrentTab: options.currentTab ? options.currentTab : 0,
//买菜数据
carrystatusTab: options.current ? options.current : "all", // 订单状态
carrystatus: "all",
carryis_dianping: options.is_dianping ? options.is_dianping : 0,
carrycurrentTab: options.currentTab ? options.currentTab : 0,
})
//外卖状态栏
eleOrdStatus({}).then(res => {
if (res.code == 0) {
this.setData({
elebtList: Utils.checkArray(res.data) ? res.data : []
})
}
})
//买菜状态栏
eleOrdStatus({
type: 'carry'
}).then(res => {
if (res.code == 0) {
this.setData({
carrybtList: Utils.checkArray(res.data) ? res.data : []
})
}
})
//商城状态栏
orderStatus({}).then(res => {
if (res.code == 0) {
let order_status_list = Utils.checkArray(res.data) ? res.data : [];
order_status_list.map((item, index) => {
if (this.data.currentTab == index) {
setTimeout(() => {
this.setData({
navScrollLeft: (index - 2) * this.data.windowWidth / 5
})
}, 200);
}
})
this.setData({
order_status_list
});
}
})
this.initializedata();
},
setUserInfo(e) { //点击了授权
if (e.detail) {
this.initializedata();
} else {
setTimeout(() => {
wx.navigateBack();
}, 700);
}
},
onShow() {
if (!wx.getStorageSync('userInfo')) {
this.setData({
hidden: true
});
return;
}
this.setData({
hidden: false
});
carryType({}).then(res => {
if (res.code == 0) {
this.setData({
isshowshoping: res.data.carry_type == 1 ? true : false
})
}
})
console.log(this.data.isshowshoping);
if (wx.getStorageSync('isDelorder')) { //有缓存的值的时候说明是订单处理后从其他页面返回来得
let isDelorder = wx.getStorageSync('isDelorder'); //列表订单各种处理后...
let obj = wx.getStorageSync('obj'); //缓存的订单信息
let order = this.data.order; //订单列表数据
let refundOrder = this.data.refundOrder //售后列表数据
if (this.data.status != 'all') { //只有不是在全部订单下才删除这一项
if (this.data.checkClassValue == 1) {
if (this.data.statusTab == 4) {
if (isDelorder == 'setRefundOrderDel') {
refundOrder.splice(obj.index, 1)
this.setData({
refundOrder
});
} else {
if (isDelorder == 'setRefundOrderCancel' || isDelorder == 'setReceivingGoods' || isDelorder == 'setDeliverGoods') { //点击了撤销售后、点击了确认收货、点击了立即发货
this.listDeal2();
}
}
} else {
order.splice(obj.index, 1); //删除某项
this.setData({
order
});
}
} else {
eleorder.splice(obj.index, 1); //删除某项
this.setData({
eleorder
});
}
wx.setStorageSync('isDelorder', ''); //清除方法
} else {
//从退款返回、完成评价返回、点击了待收货退款、点击了待发货退款
if (isDelorder == 'applyRefund' || isDelorder == 'getDianPing' || isDelorder == 'getPay' || isDelorder == 'applyRefundOrder' || isDelorder == 'GoodsApplyRefund' || isDelorder == 'daojishi') {
if (this.data.status != 'all') { //只有不是在全部订单下才删除这一项
order.splice(obj.index, 1); //删除某项
this.setData({
order
});
wx.setStorageSync('isDelorder', ''); //清除方法
} else {
this.listDeal();
}
} else if (isDelorder == 'delorder') { //点击删除回来的
order.splice(obj.index, 1); //删除某项
this.setData({
order
});
wx.setStorageSync('isDelorder', ''); //清除方法
}
}
wx.pageScrollTo({
scrollTop: wx.getStorageSync('scrollTop'),
duration: 0
});
}
// 自动跳转到售后/退款
if (wx.getStorageSync('statusTab')) {
this.setData({
statusTab: wx.getStorageSync('statusTab'),
order: [],
status: '4,5,6,7',
is_loading_done: false,
currentTab: 6,
pageNum: 1,
navScrollLeft: (6 - 2) * (this.data.windowWidth / 5)
})
setTimeout(() => {
wx.setStorageSync('statusTab', '');
this.initializedata();
}, 100);
}
},
// 刷新正常订单
listDeal() {
let obj = wx.getStorageSync('obj');
let order = this.data.order;
let eleorder = this.data.eleorder;
wx.showLoading({
title: "请稍后..."
});
if (this.data.checkClassValue == 1) {
orderList({
status: this.data.status,
is_dianping: this.data.is_dianping,
page: Math.ceil((obj.index + 1) / 10)
}).then(res => {
wx.hideLoading();
for (let item of res.data) {
if (item.order_id == obj.order_id) {
order[obj.index] = item;
this.setData({
order
});
break;
}
}
})
} else if (this.data.checkClassValue == 2) {
eleOrdList({
status: this.data.elestatus,
is_dianping: this.data.eleis_dianping,
page: Math.ceil((obj.index + 1) / 10)
}).then(res => {
wx.hideLoading();
for (let item of res.data.list) {
if (item.order_id == obj.order_id) {
eleorder[obj.index] = item;
this.setData({
eleorder
});
break;
}
}
})
} else {
console.log('买菜还没有售后')
}
wx.setStorageSync('isDelorder', ''); //清除方法
},
// 刷新售后订单
listDeal2() {
let refund = wx.getStorageSync('refund');
let refundOrder = this.data.refundOrder;
wx.showLoading({
title: "请稍后..."
});
if (this.data.checkClassValue == 1) {
getRefundOrderList({
page: Math.ceil((refund.index + 1) / 10),
pagesize: 20
}).then(res => {
wx.hideLoading();
// console.log(res)
for (let item of res.data) {
if (item.refund_id == refund.refund_id) {
refundOrder[refund.index] = item;
this.setData({
refundOrder
});
break;
}
}
})
}
//wx.setStorageSync('isDelorder', ''); //清除方法
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
var pageNum = this.data.pageNum;
var elepageNum = this.data.elepageNum
this.setData({
pageNum: 1,
order: [],
is_loading_done: false,
elepageNum: 1,
eleorder: [],
eleis_loading_done: false
})
wx.showToast({
title: '正在刷新',
icon: 'loading',
mask: true
})
this.initializedata();
wx.stopPullDownRefresh();
},
loadmore() {
var pageNum = parseInt(this.data.pageNum) + 1;
var elepageNum = parseInt(this.data.pageNum) + 1;
var carrypageNum = parseInt(this.data.pageNum) + 1;
this.setData({
pageNum: pageNum,
elepageNum: elepageNum,
carrypageNum:carrypageNum
})
this.initializedata()
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom(e) {
var is_loading_done = this.data.is_loading_done; //是否加载完毕
if (is_loading_done == false) { //还没加载完毕则继续加载
wx.showLoading({
title: '加载中',
mask: false
})
this.loadmore();
} else {
wx.showLoading({
title: '已全部加载完毕',
mask: false
})
setTimeout(function () {
wx.hideLoading()
}, 1000)
}
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
/**
* 顶部导航选中
*/
selectOrderStatus(event) {
var cur = event.currentTarget.dataset.current;
//每个tab选项宽度占1/5
var singleNavWidth = this.data.windowWidth / 5;
let statusTab = event.currentTarget.dataset.statustab;
let status = event.currentTarget.dataset.status;
let is_dianping = event.currentTarget.dataset.is_dianping;
this.setData({
order: [],
statusTab: statusTab,
status: status,
is_dianping: is_dianping,
is_loading_done: false,
currentTab: event.target.dataset.current,
pageNum: 1,
navScrollLeft: (cur - 2) * singleNavWidth
})
this.initializedata();
if (this.data.currentTabs == cur) {
return false;
} else {
this.setData({
currentTabs: cur
})
}
},
/**
* 顶部导航选中
*/
eleselectOrderStatus(e) {
let btList = this.data.elebtList;
let index = e.detail.index;
let elestatusTab = btList[index].status_id;
let elestatus = btList[index].status;
let eleis_dianping = btList[index].is_dianping;
this.setData({
eleorder: [],
elestatusTab,
elestatus,
eleis_dianping,
eleis_loading_done: false,
elecurrentTab: index,
elepageNum: 1,
})
this.initializedata();
},
/**
* 买菜顶部导航选中
*/
carrySelectOrderStatus(e) {
let btList = this.data.elebtList;
let index = e.detail.index;
let elestatusTab = btList[index].status_id;
let elestatus = btList[index].status;
let eleis_dianping = btList[index].is_dianping;
this.setData({
eleorder: [],
elestatusTab,
elestatus,
eleis_dianping,
eleis_loading_done: false,
elecurrentTab: index,
elepageNum: 1,
})
this.initializedata();
},
/**
* 外卖顶部导航选中
*/
eleselectOrderStatus(e) {
let btList = this.data.elebtList;
let index = e.detail.index;
let elestatusTab = btList[index].status_id;
let elestatus = btList[index].status;
let eleis_dianping = btList[index].is_dianping;
this.setData({
eleorder: [],
elestatusTab,
elestatus,
eleis_dianping,
eleis_loading_done: false,
elecurrentTab: index,
elepageNum: 1,
})
this.initializedata();
},
/**
* 买菜顶部导航选中
*/
carryselectOrderStatus(e) {
let btList = this.data.carrybtList;
let index = e.detail.index;
let carrystatusTab = btList[index].status_id;
let carrystatus = btList[index].status;
let carryis_dianping = btList[index].is_dianping;
this.setData({
carryorder: [],
carrystatusTab,
carrystatus,
carryis_dianping,
carryis_loading_done: false,
carrycurrentTab: index,
carrypageNum: 1,
})
this.initializedata();
},
/**
* 初始化数据
*/
initializedata: function () {
var that = this;
if (that.data.checkClassValue == 1) {
if (that.data.statusTab == 4) {
wx.showLoading({
title: '加载中',
mask: false
})
getRefundOrderList({
page: parseInt(that.pageNum) ? parseInt(that.pageNum) : (0 + 1),
pagesize: 20,
}).then(res => {
wx.hideLoading(); //结束加载
if (res.data == null || res.data.length == 0) {
that.setData({
is_loading_done: true,
})
} else {
let my_refundOrder = res.data
that.setData({
refundOrder: my_refundOrder,
})
}
})
return;
}
orderList({
status: that.data.status,
is_dianping: that.data.is_dianping,
page: parseInt(that.data.pageNum) ? parseInt(that.data.pageNum) : (0 + 1),
}).then(res => {
if (res.data == null || res.data.length == 0) {
that.setData({
is_loading_done: true,
})
} else {
var my_order = that.data.order;
my_order = my_order.concat(res.data);
that.setData({
order: my_order,
})
}
wx.hideLoading();
})
} else if (that.data.checkClassValue == 2) {
wx.showLoading({
title: '加载中',
})
eleOrdList({
status: that.data.elestatus,
is_dianping: that.data.eleis_dianping,
page: parseInt(that.data.elepageNum) ? parseInt(that.data.elepageNum) : (0 + 1),
}).then(res => {
if (res.data.list == null || res.data.list.length == 0) {
that.setData({
eleis_loading_done: true,
})
} else {
var my_order = that.data.eleorder;
my_order = my_order.concat(res.data.list);
that.setData({
eleorder: my_order,
})
}
wx.hideLoading();
})
} else {
wx.showLoading({
title: '加载中',
})
eleOrdList({
status: that.data.carrystatus,
is_dianping: that.data.carryis_dianping,
page: parseInt(that.data.carrypageNum) ? parseInt(that.data.carrypageNum) : (0 + 1),
type: 'carry'
}).then(res => {
if (res.data.list == null || res.data.list.length == 0) {
that.setData({
carryis_loading_done: true,
})
} else {
var my_order = that.data.carryorder;
my_order = my_order.concat(res.data.list);
that.setData({
carryorder: my_order,
})
}
wx.hideLoading();
})
}
},
//根据商家id判断应该跳到商家页面
shoplist: function (e) {
var shop_id = e.currentTarget.dataset.shop_id;
luma.bindclassifyUrl(shop_id);
},
//跳转详情页
elejumpDd(e) {
let shop_id = e.currentTarget.dataset.shop_id;
luma.bindclassifyUrl(shop_id);
},
//外卖订单详情
elesearchOrder(e) {
let order_id = e.currentTarget.dataset.order_id
let status = e.currentTarget.dataset.status
// if (status==0){
wx: wx.navigateTo({
url: '/pages/shop/order/eleorder/eleLine_item/eleLine_item?order_id=' + order_id,
})
// }else{
// wx: wx.navigateTo({
// url: '/pages/shop/order/eleorder/order_status_user/order_status_user?order_id=' + order_id,
// })
// }
},
//买菜订单详情
carrysearchOrder(e) {
let order_id = e.currentTarget.dataset.order_id
let status = e.currentTarget.dataset.status
// if (status==0){
wx: wx.navigateTo({
url: '/pages/shop/order/eleorder/eleLine_item/eleLine_item?order_id=' + order_id,
})
// }else{
// wx: wx.navigateTo({
// url: '/pages/shop/order/eleorder/order_status_user/order_status_user?order_id=' + order_id,
// })
// }
},
/**
* 外卖订单操作
*/
eleoperation(event) {
let action = event.currentTarget.dataset.action;
let order_id = event.currentTarget.dataset.orderid;
let index = event.currentTarget.dataset.index;
wx.setStorageSync('obj', {
order_id: order_id,
index: index
});
switch (action) {
case 'getPay': //支付
this.eleorderDetails(order_id, index);
break;
case 'delorder': //删除订单
this.elerequestOrder(order_id, action, index);
break;
case 'affirmReceiving': //订单确认收货
this.elerequestOrder(order_id, action, index);
break;
case 'orderDetails': //订单详情
this.eleorderDetails(order_id, index);
break;
case 'getDianPing': //评论
this.elegoEvaluate(event, index);
break;
case 'applyRefund': //申请退款
this.eleapplyRefund(order_id, action, index);
break;
case 'cancelRefund': //撤销退款
this.elerequestOrder(order_id, action, index);
break;
case 'againOneSingle': //再来一单
this.elejumpDd(event, index);
break;
default:
this.elerequestOrder(order_id, action, index);
break;
}
},
/**
* 外卖订单操作
*/
carryoperation(event) {
// console.log(event)
// return;
let action = event.currentTarget.dataset.action;
let order_id = event.currentTarget.dataset.orderid;
let shop_id = event.currentTarget.dataset.shopid;
let index = event.currentTarget.dataset.index;
let nucleus_code = event.currentTarget.dataset.nucleus_code
let collection_time = event.currentTarget.dataset.collection_time
wx.setStorageSync('obj', {
order_id: order_id,
index: index
});
switch (action) {
case 'getPay': //支付
this.eleorderDetails(order_id, index);
break;
case 'delorder': //删除订单
this.carryrequestOrder(order_id, action, index);
break;
case 'affirmReceiving': //订单确认收货
this.carryrequestOrder(order_id, action, index);
break;
case 'orderDetails': //订单详情
this.carryorderDetails(order_id, index);
break;
case 'getDianPing': //评论
this.elegoEvaluate(event, index);
break;
case 'applyRefund': //申请退款
this.eleapplyRefund(order_id, action, index);
break;
case 'cancelRefund': //撤销退款
this.elerequestOrder(order_id, action, index);
break;
case 'againOneSingle': //再来一单
this.elejumpDd(event, index);
break;
case 'verification_code': //买菜二维码
this.popupEwm(nucleus_code, collection_time);
break;
case 'confirm': //买菜二维码
this.carryhexiao(shop_id, order_id, index);
break;
default:
this.elerequestOrder(order_id, action, index);
break;
}
},
/**
* 订单操作
*/
operation: function (event) {
console.log(event)
let that = this;
let action = event.currentTarget.dataset.action;
let order_id = event.currentTarget.dataset.orderid;
let vendor_id = event.currentTarget.dataset.vendor_id;
let refund_id = event.currentTarget.dataset.refundid;
let index = event.currentTarget.dataset.index;
wx.setStorageSync('obj', {
order_id: order_id,
index: index
});
wx.setStorageSync('refund', {
refund_id: refund_id,
index: index
});
switch (action) {
case 'getPay': //支付
this.orderDetails(order_id, index);
break;
case 'delorder': //删除订单
this.requestOrder(order_id, action, index);
break;
case 'affirmPirk': //买家自提确认取货
this.requestOrder(order_id, action, index);
break;
case 'checkLogistics': //查看物流
this.logistics(order_id, action, vendor_id, index);
break;
case 'affirmReceiving': //订单确认收货
this.requestOrder(order_id, action, index);
break;
case 'orderDetails': //订单详情
this.orderDetails(order_id, index);
break;
case 'getDianPing': //评论
this.goEvaluate(order_id, index);
break;
case 'applyRefund': //申请退款
this.applyRefund(order_id, action, index);
break;
case 'cancelRefund': //撤销退款
this.requestOrder(order_id, action, index);
break;
case 'pay_presell': //预定金支付
this.payPresell(order_id, index);
break;
// 售后/退款新接口
case 'getRefundDetail': //售后订单详情
that.getRefundDetail(refund_id);
break;
case 'getApplyRefund': //待收货申请售后
that.getApplyRefund(order_id, action);
break;
case 'setRefundOrderCancel': //撤销售后
that.setRefundOrderCancel(refund_id);
break;
case 'setRefundOrderDel': //撤销售后之后删除订单
that.setRefundOrderDel(refund_id);
break;
case 'setDeliverGoods': //同意售后 立即发货
that.setDeliverGoods(refund_id);
break;
case 'viewLogistics': //售后换货待用户收货 查看物流
that.viewLogistics(refund_id);
break;
case 'setReceivingGoods': //售后换货 确认收货
that.setReceivingGoods(refund_id);
break;
default:
this.requestOrder(order_id, action, index);
break;
}
},
//查看物流
logistics: function (order_id, action, vendor_id) {
wx.navigateTo({
url: '/pages/shop/order/weidianorder/check_logistics/check_logistics?order_id=' + order_id + '&action=' + action + '&vendor_id=' + vendor_id
})
},
//跳转订单详情
orderDetails: function (order_id) {
wx.navigateTo({
url: '/pages/shop/order/weidianorder/weidianLine_item/weidianLine_item?order_id=' + order_id,
})
},
//跳转售后订单详情
getRefundDetail: function (refund_id) {
wx.navigateTo({
url: '/pages/shop/order/weidianorder/weidianLine_refund/weidianLine_refund?refund_id=' + refund_id,
})
},
//发货后申请退款
getApplyRefund(order_id) {
wx.navigateTo({
url: '/pages/shop/order/weidianorder/sales_refund/sales_refund?order_id=' + order_id + "&action=getApplyRefund"
})
},
//待发货状态直接申请退款
applyRefund: function (order_id, action) {
wx.navigateTo({
url: '/pages/shop/order/weidianorder/sales_return/sales_return?order_id=' + order_id + '&action=' + action
})
},
// 同意售后 立即发货
setDeliverGoods(refund_id) {
wx.navigateTo({
url: '/pages/shop/order/weidianorder/express_delivery/express_delivery?refund_id=' + refund_id
})
},
//查看物流
viewLogistics(refund_id) {
wx.navigateTo({
url: '/pages/shop/order/weidianorder/logistics/logistics?refund_id=' + refund_id
});
},
// 请求后台操作撤销售后
setRefundOrderCancel(refund_id, index) {
let params = {
refund_id: refund_id
}
wx.showModal({
title: '提示',
content: '是否确认撤销售后?',
success: res => {
if (res.confirm) {
setRefundOrderCancel(params).then(res => {
if (res.code == 0) {
wx.showToast({
title: '撤销成功',
duration: 2000,
icon: 'none'
});
this.listDeal2();
} else {
wx.showToast({
title: res.msg,
duration: 2000,
icon: 'none'
});
}
})
}
}
})
},
// 撤销售后之后删除订单
setRefundOrderDel(refund_id, index) {
let params = {
refund_id: refund_id
}
wx.showModal({
title: '提示',
content: '是否确认删除订单?',
success: res => {
if (res.confirm) {
setRefundOrderDel(params).then(res => {
if (res.code == 0) {
wx.showToast({
title: '删除成功',
duration: 2000,
icon: 'none'
});
let refundOrder = this.data.refundOrder;
refundOrder.splice(index, 1)
this.setData({
refundOrder
})
} else {
wx.showToast({
title: res.msg,
duration: 2000,
icon: 'none'
});
}
})
}
}
})
},
// 售后换货 确认收货
setReceivingGoods(refund_id, index) {
let params = {
refund_id: refund_id
}
wx.showModal({
title: '提示',
content: '是否确认收货?',
success: res => {
if (res.confirm) {
setReceivingGoods(params).then(res => {
if (res.code == 0) {
wx.showToast({
title: '收货成功',
duration: 2000,
icon: 'none'
});
this.listDeal2();
} else {
wx.showToast({
title: res.msg,
duration: 2000,
icon: 'none'
});
}
})
}
}
})
},
//外卖跳转订单详情
eleorderDetails: function (order_id) {
wx.navigateTo({
url: '/pages/shop/order/eleorder/eleLine_item/eleLine_item?order_id=' + order_id,
})
},
//去点评
goEvaluate: function (orderid) {
wx.navigateTo({
url: '/pages/shop/order/weidianorder/evaluation_weidian/evaluation_weidian?order_id=' + orderid,
})
},
//外卖评价
elegoEvaluate(e) {
let shop_id = e.target.dataset.shopid;
let shop_name = e.target.dataset.shopname;
let photo = e.target.dataset.photo;
let order_id = e.currentTarget.dataset.orderid;
wx.navigateTo({
url: '/pages/shop/order/eleorder/evaluation_ele/evaluation_ele?shop_id=' + shop_id + '&shop_name=' + shop_name + '&photo=' + photo + '&order_id=' + order_id,
})
},
//申请退款
applyRefund(order_id, action, index) {
wx.navigateTo({
url: '/pages/shop/order/weidianorder/sales_return/sales_return?order_id=' + order_id + '&action=' + action
})
},
// 外卖申请退款
eleapplyRefund: function (order_id, action) {
wx.navigateTo({
url: '/pages/shop/order/eleorder/ele_sales_return/ele_sales_return?order_id=' + order_id + "&action=" + action,
})
},
//请求后台操作订单
requestOrder(order_id, action, index) {
let that = this;
let params = {
order_id: order_id,
action: action,
};
if (action == 'delorder') {
wx.showModal({
title: '删除订单',
content: '是否确定删除订单?',
success: (res) => {
if (res.confirm) {
requestOrder(params).then(res => {
wx.showToast({
title: res.msg,
icon: 'none'
})
let order = this.data.order;
order.splice(index, 1); //删除某项
this.setData({
order
});
})
}
}
})
} else {
requestOrder(params).then(res => {
if (res.code == 0) {
wx.showToast({
title: res.msg,
icon: 'none'
});
if (that.data.status != "all") {
let order = that.data.order;
order.splice(index, 1); //删除某项
that.setData({
order
});
} else {
that.listDeal();
}
}
})
}
},
//请求后台操作订单
carryrequestOrder(order_id, action, index) {
let params = {
order_id: order_id,
action: action,
};
if (action == 'delorder') {
wx.showModal({
title: '删除订单',
content: '是否确定删除订单?',
success: (res) => {
if (res.confirm) {
requestEleOrder(params).then(res => {
if (res.code == 0) {
wx.showToast({
title: res.msg,
icon: 'none'
})
let carryorder = this.data.carryorder;
carryorder.splice(index, 1); //删除某项
this.setData({
carryorder
});
} else {
app.showToast({
title: res.msg,
});
}
})
}
}
})
} else {
requestEleOrder(params).then(res => {
if (res.code == 0) {
wx.showToast({
title: res.msg,
icon: 'none'
})
if (this.data.status != "all") {
let carryorder = that.data.carryorder;
carryorder.splice(index, 1); //删除某项
this.setData({
carryorder
});
} else {
this.listDeal();
}
} else {
app.showToast({
title: res.msg,
});
}
})
}
},
//请求后台操作订单
elerequestOrder(order_id, action, index) {
let params = {
order_id: order_id,
action: action,
};
if (action == 'delorder') {
wx.showModal({
title: '删除订单',
content: '是否确定删除订单?',
success: (res) => {
if (res.confirm) {
requestEleOrder(params).then(res => {
if (res.code == 0) {
wx.showToast({
title: res.msg,
icon: 'none'
})
let eleorder = this.data.eleorder;
eleorder.splice(index, 1); //删除某项
this.setData({
eleorder
});
} else {
app.showToast({
title: res.msg,
});
}
})
}
}
})
} else {
requestEleOrder(params).then(res => {
if (res.code == 0) {
wx.showToast({
title: res.msg,
icon: 'none'
})
if (this.data.status != "all") {
let eleorder = that.data.eleorder;
eleorder.splice(index, 1); //删除某项
this.setData({
eleorder
});
} else {
this.listDeal();
}
} else {
app.showToast({
title: res.msg,
});
}
})
}
},
//头部选择事件
checkoutClass(e) {
wx.pageScrollTo({
scrollTop: 0,
duration: 0
});
if(this.data.checkClassValue == e.currentTarget.dataset.checktype){
console.log('你点的速度太快了')
return;
}
this.setData({
checkClassValue: e.currentTarget.dataset.checktype,
is_loading_done: false,
pageNum:1,
elepageNum:1,
carrypageNum:1,
order:[],
eleorder:[],
carryorder:[],
});
this.initializedata();
console.log('sfasfasfasfasfasfasfas');
},
popupEwm(nucleus_code, collection_time) {
// console.log(e)
// return;
this.setData({
showpop: true,
ewmUrl: nucleus_code,
collection_time: collection_time
})
console.log('二维码弹窗')
},
close() {
this.setData({
showpop: false,
ewmUrl: ''
})
},
//买菜核销
carryhexiao(shopid, orderid, index) {
console.log('carryhexiao')
let that = this
wx.showModal({
title: '提示',
content: '确定核销吗?',
success: function (res) {
if (res.confirm) {
ele_carry({
shop_id: shopid,
order_id: orderid
}).then(res => {
if (res.code == 0) {
that.data.carryorder.splice(index, 1); //删除某项
that.setData({
carryorder: that.data.carryorder
});
} else {
wx.showToast({
title: res.msg,
icon: "none"
})
}
})
} else {
console.log('取消')
}
}
})
}
// shopingstatuschange(e){
// console.log(e)
// },
})
\ No newline at end of file
{
"usingComponents": {
"method_payment": "/components/dialog/method_payment/method_payment",
"van-tab": "/@vant/weapp/lib/tab/index",
"van-tabs": "/@vant/weapp/lib/tabs/index",
"mp-dialog": "/@vant/weapp/lib/popup/index"
},
"navigationBarTitleText": "我的订单",
"enablePullDownRefresh": true
}
\ No newline at end of file
<!-- tab -->
<view class="checkClassCss" style="border: 1px solid #eee;z-index:99">
<view style="height: 100%;line-height: 82rpx;border-right:2rpx solid #eee;" class="checkAnother {{checkClassValue==1?'Classactivie':'' }}" data-checkType="1" catchtap="checkoutClass">
商城订单
</view>
<view style="height: 100%;line-height: 82rpx;" class="checkAnother {{checkClassValue==2?'Classactivie':'' }}" data-checkType="2" catchtap="checkoutClass">
外卖订单
</view>
<view wx:if="{{isshowshoping}}" style="height: 100%;line-height: 82rpx;border-left:2rpx solid #eee;" class="checkAnother {{checkClassValue==3?'Classactivie':'' }}" data-checkType="3" catchtap="checkoutClass">
买菜订单
</view>
</view>
<view wx:if="{{checkClassValue==1}}">
<view class='tab_wrap fu_top po_f' style="top:100rpx">
<scroll-view scroll-x="true" class="nav" scroll-left="{{navScrollLeft}}" scroll-with-animation="{{true}}" style="top:80rpx;height:100rpx;line-height:100rpx">
<block wx:for="{{order_status_list}}" wx:for-index="idx" wx:key="idx">
<view class="nav-item" data-current="{{idx}}" data-statusTab="{{item.status_id}}" data-status="{{item.status}}" data-is_dianping="{{item.is_dianping}}" catchtap='selectOrderStatus'>
<view class="activeszi {{currentTab == idx ?'activezi':''}}" data-current="{{idx}}" data-statusTab="{{item.status_id}}" data-status="{{item.status}}" data-is_dianping="{{item.is_dianping}}" catchtap='selectOrderStatus'>{{item.status_name}}</view>
<view class="xiabia {{currentTab == idx ?'xiabias':''}}"></view>
</view>
</block>
</scroll-view>
</view>
<!-- 内容 -->
<view class="boxs" style="margin-top: 100rpx;">
<!-- 正常订单 -->
<view wx:if="{{statusTab != 4}}">
<!-- 没有订单显示 -->
<view class="te_ct meybox" wx:if="{{order.length==0}}">
<view class="meyimg">
<image src="{{clientImgPath}}/images/wm/meiyou.png"></image>
</view>
<view class="sz_42 inp_hui mt-30">您还没有订单记录</view>
</view>
<!-- s -->
<block wx:for='{{order}}' wx:key='index' wx:for-item="item">
<view class="topbox_20 mb-20">
<view class="ali-z">
<view class="ali-c flex1" data-shop_id="{{item.shop_id}}" bindtap="shoplist">
<view class="tubiimg mr-20">
<image src="{{clientImgPath}}/images/yx/dianpu@2x.png"></image>
</view>
<view class="bt_min flex1 oneline">{{item.shop_name}}</view>
</view>
<view class="sz_30 c_ff ml-20">{{item.order_status}}</view>
</view>
<view class="sz_24 inp_hui mt-10">{{item.create_time}}</view>
<view class="ali-z mt-20 mb-20" wx:if="{{item.sale_status}}">
<view class="ali-c flex1">
<view class="tubiimg mr-20"></view>
<view class="bt_min flex1 oneline"></view>
</view>
<view class="sz_24 c_ff ml-20">({{item.sale_status}})</view>
</view>
<view wx:if='{{!item.sale_status}}' class="mt-20"></view>
<view class="mb-20" wx:for='{{item.products}}' wx:for-index="vendorid" wx:for-item="orderG" data-orderid='{{item.order_id}}' catchtap="operation" data-index="{{index}}" data-action='orderDetails' wx:key="vendorid">
<view wx:for='{{orderG.orderGoods}}' wx:for-item="product" class="flex" style="margin:0 0 20rpx 0;" wx:key="key">
<view class="tuimg br_10 ov">
<image src='{{img_host}}/attachs/{{product.photo}}' wx:if="{{product.photo}}"></image>
<image src='{{img_host}}/attachs/{{item.photo}}' wx:else></image>
</view>
<view class="flex1 ml-25">
<view class="sz_30 bt_hei twoline" style="height:84rpx">{{product.goods_name}}</view>
<block wx:if="{{product.goods_name !='快捷支付'}}">
<view class="sz_26 bt_hei mt-10 ali-c">
<text wx:if="{{item.buytype==1}}">{{product.fprice}}元</text>
<view class="cFF69 s26 ml-20 fwb"
wx:if="{{item.status==1&&item.money!=0||item.status==8&&item.money!='0.00'}}"
>
( 已返{{item.money}}元佣金 )
</view>
<view class="cFF69 s26 ml-20 fwb" wx:if="{{item.status==0&&item.money!=0}}">( 可返{{item.money}}元佣金 )</view>
</view>
<view class="sz_26 inp_hui mt-10">{{product.sku_name||''}}
</view>
<view class="sz_26 inp_hui mt-10">数量: x {{product.goodsnum}}</view>
</block>
</view>
</view>
<block wx:for='{{orderG.operation}}' wx:for-item="action" wx:for-index='index2' wx:key="index2">
<view class='sz_28 ml-20 {{action.class_name}}' data-orderid='{{item.order_id}}' catchtap="operation" data-action='{{action.way}}' data-vendor_id="{{vendorid}}" data-is_ld='{{item.buytype}}' data-index="{{index}}">{{action.name}}
</view>
</block>
</view>
<view class="xian mt-10 mb-30"></view>
<view class="ali-z sz_30 bt_hei" bindtap="eleLine">
<view wx:if='{{item.message}}'>备注:{{item.message}}</view>
<view class="ml-20 sz_32 bt_hei">合计:¥{{item.total}}</view>
</view>
<view class="xian mt-30 mb-30"></view>
<view class="s24 cFF69" style="padding: 20upx;" wx:if="{{item.money!=0&&item.status!=-2}}">提示:参与返佣金产品不支持退款</view>
<view class="ali-z sz_30 bt_hei" wx:if="{{item.status>=4 && item.status<=7}}" bindtap="eleLine">
<view> 退款理由: {{item.refund_details||''}}</view>
</view>
<view class="xian mt-30 mb-30" wx:if="{{item.status>=4 && item.status<=7}}"></view>
<view class="ali-z">
<view></view>
<view class="disf ali-c ">
<block wx:for='{{item.order_operation}}' wx:for-item="action" wx:for-index="index2" wx:key="index2" wx:if="{{(item.money>0)?action.name!='申请退款':true}}">
<view style="background: linear-gradient(#F88057, #F64F15);color: #ffffff;border-radius: 70rpx;" class="sz_28 mr-15 itemBtn {{action.class_name}}" data-orderid='{{item.order_id}}' catchtap="operation" data-index="{{index}}" data-action='{{action.way}}' data-is_ld='{{item.buytype}}'>
{{action.name}}
</view>
</block>
</view>
</view>
</view>
</block>
</view>
<!-- 售后订单 -->
<view wx:if="{{statusTab == 4}}">
<!-- 没有订单显示 -->
<view class="te_ct meybox" wx:if="{{refundOrder.length==0}}">
<view class="meyimg">
<image src="{{clientImgPath}}/images/wm/meiyou.png"></image>
</view>
<view class="sz_42 inp_hui mt-30">您还没有订单记录</view>
</view>
<!-- s -->
<block wx:for='{{refundOrder}}' wx:key='index' wx:for-item="items">
<view class="topbox_20 mb-20">
<view class="ali-z">
<view class="ali-c flex1" data-shop_id="{{items.shop_id}}" bindtap="shoplist">
<view class="tubiimg mr-20">
<image src="{{clientImgPath}}/images/yx/dianpu@2x.png"></image>
</view>
<view class="bt_min flex1 oneline">{{items.shop_name}}</view>
</view>
<view class="sz_30 c_ff ml-20">{{items.status_text}}</view>
</view>
<view class="sz_24 inp_hui mt-10">{{items.create_time}}</view>
<view class="ali-z mt-20 mb-20" wx:if="{{item.sale_status}}">
<view class="ali-c flex1">
<view class="tubiimg mr-20"></view>
<view class="bt_min flex1 oneline"></view>
</view>
</view>
<view class="mb-20" wx:for='{{items.ordergoods}}' wx:for-index="vendorid" wx:for-item="orderRefund" data-orderid='{{item.order_id}}' data-refundid="{{items.refund_id}}" catchtap="operation" data-index="{{index}}" data-action='getRefundDetail' wx:key="vendorid">
<view class="flex" style="margin:0 0 20rpx 0;">
<view class="tuimg br_10 ov">
<image src='{{img_host}}/attachs/{{orderRefund.photo}}' wx:if="{{orderRefund.photo}}"></image>
<image src='{{img_host}}/attachs/{{orderRefund.photo}}' wx:else></image>
</view>
<view class="flex1 ml-25">
<view class="sz_30 bt_hei twoline" style="height:84rpx">{{orderRefund.goods_name}}</view>
<block wx:if="{{product.goods_name !='快捷支付'}}">
<view class="sz_26 bt_hei mt-10">
<text>{{orderRefund.price}}元</text>
</view>
<view class="sz_26 inp_hui mt-10">{{orderRefund.sku_name||''}}
</view>
<view class="sz_26 inp_hui mt-10">数量: x {{orderRefund.num}}</view>
</block>
</view>
<block wx:for='{{orderG.operation}}' wx:for-index="idx" wx:key="idx" wx:for-item="action">
<view style="background: linear-gradient(#F88057, #F64F15);color: #ffffff;border-radius: 70rpx;" class='sz_28 ml-20 {{action.class_name}}' data-orderid='{{item.order_id}}' catchtap="operation" data-action='{{action.way}}' data-vendor_id="{{vendorid}}" data-is_ld='{{item.buytype}}' data-index="{{index}}">
{{action.name}}
</view>
</block>
</view>
<view class="xian mt-10 mb-30"></view>
<view class="ali-z sz_30 bt_hei" bindtap="eleLine">
<!-- <view wx:if='{{items.message}}'>备注:{{items.message}}</view> -->
<view class="ml-20 sz_32 bt_hei">合计:¥{{items.refund_price}}</view>
</view>
<view class="xian mt-30 mb-30"></view>
<view class="ali-z">
<view></view>
<view class="ali-c">
<block wx:for='{{items.user_button}}' wx:for-item="action" wx:for-index="index2" wx:key="index2" wx:if="{{items.user_button != ''}}">
<view class='sz_28 ml-20 {{action.class_name}}' data-type='{{items.type}}' catchtap="operation" data-action='{{action.way}}' data-orderid="{{orderRefund.order_id}}" data-index="{{index}}" data-refundid='{{items.refund_id}}'>{{action.name}}</view>
</block>
</view>
</view>
</view>
</view>
</block>
</view>
</view>
</view>
<view wx:if="{{checkClassValue==2}}">
<van-tabs active="{{ elecurrentTab }}" bind:change="eleselectOrderStatus" style="position:fixed;width:100%;top:80rpx;">
<van-tab wx:for="{{elebtList}}" wx:key="index" title="{{item.status_name}}" style="line-height: 88rpx;">
</van-tab>
</van-tabs>
<view class="boxs">
<view style="margin-top:90rpx">
<!-- 没有订单显示 -->
<view class="te_ct meybox" wx:if='{{eleorder.length<1}}'>
<view class="meyimg">
<image src="{{clientImgPath}}/images/wm/meiyou.png"></image>
</view>
<view class="sz_42 inp_hui mt-30">您还没有订单记录</view>
</view>
<!-- s -->
<block wx:for='{{eleorder}}' wx:key='index'>
<view class="topbox_20 mb-20" data-order_id="{{item.order_id}}" data-status="{{item.status}}" bindtap="elesearchOrder">
<!-- <view style="position:absolute;">买菜角标</view> -->
<view>
<view class="ali-c">
<view class="spimg ov" data-shop_id="{{item.shop_id}}">
<image src="{{img_host}}/attachs/{{item.photo}}"></image>
</view>
<view class="ml-20 flex1">
<view class="ali-z">
<view class="sz_28 bt_heibl flex1" data-shop_id="{{item.shop_id}}" catchtap="jumpDd">
{{item.shop_name}}</view>
<view class="sz_30 c_ff twb">{{item.order_status}}</view>
</view>
<view class="sz_24 bt_hei mt-20">{{item.createtime}}</view>
</view>
</view>
<block wx:for="{{item.products}}" wx:for-item="goods" wx:for-index="goodsindex" wx:key="goodsindex" class="mt-20">
<view class="ali-z mt-10 mb-10">
<view class="sz_30 bt_hei">
<text>{{goods.productname}}</text><text hidden="{{item.code.length==0}}">({{item.code}})</text>
x<text>{{goods.goodsnum}}</text>
</view>
</view>
<view class="xian" data-jj="goodsindex" wx:if='{{index!=item.products.length-1}}'>
</view>
</block>
</view>
<view class="xian mb-30"></view>
<view class="ali-z sz_30 bt_hei">
<view class="flex1">备注:{{item.remark||''}}</view>
<view class="ml-20">合计:¥{{item.total}}</view>
</view>
<view class="xian mt-30 mb-30"></view>
<view class="ali-zs">
<!-- <view class="button" data-item="{{item}}" wx:if="{{item.type == 'carry' && item.delivery_type== 0 && item.nucleus==0 }}" catchtap="popupEwm">
买菜二维码
</view> -->
<block wx:for='{{item.order_operation}}' wx:for-item="action" wx:for-index="btnindex" wx:key="btnindex" wx:if="{{(item.fan_money==0.00)?true:action.name!='申请退款'}}">
<view style="background: linear-gradient(#F88057, #F64F15);color: #ffffff;border-radius: 70rpx;" class='sz_28 ml-20 {{action.class_name}}' data-shopid="{{item.shop_id}}" data-photo="{{item.photo}}" data-shopname="{{item.shop_name}}" data-orderid='{{item.order_id}}' catchtap="eleoperation" data-index="{{index}}" data-action='{{action.way}}' data-is_ld='{{item.buytype}}'>
{{action.name}}
</view>
</block>
</view>
</view>
</block>
</view>
</view>
</view>
<view wx:if="{{checkClassValue==3 && isshowshoping }}" >
<van-tabs active="{{ carrycurrentTab }}" bind:change="carryselectOrderStatus" style="position:fixed;width:100%;top:80rpx;">
<van-tab wx:for="{{carrybtList}}" wx:key="index" title="{{item.status_name}}" style="line-height: 88rpx;">
</van-tab>
</van-tabs>
<view class="boxs">
<view style="margin-top:90rpx">
<!-- 没有订单显示 -->
<view class="te_ct meybox" wx:if='{{carryorder.length<1}}'>
<view class="meyimg">
<image src="{{clientImgPath}}/images/wm/meiyou.png"></image>
</view>
<view class="sz_42 inp_hui mt-30">您还没有订单记录</view>
</view>
<!-- s -->
<block wx:for='{{carryorder}}' wx:key='index'>
<view class="topbox_20 mb-20" data-order_id="{{item.order_id}}" data-status="{{item.status}}" bindtap="carrysearchOrder">
<!-- <view style="position:absolute;">买菜角标</view> -->
<view>
<view class="ali-c">
<view class="spimg ov" data-shop_id="{{item.shop_id}}">
<image src="{{img_host}}/attachs/{{item.photo}}"></image>
</view>
<view class="ml-20 flex1">
<view class="ali-z">
<view class="sz_28 bt_heibl flex1" data-shop_id="{{item.shop_id}}" catchtap="jumpDd">
{{item.shop_name}}</view>
<view class="sz_30 c_ff twb">{{item.order_status}}</view>
</view>
<view class="sz_24 bt_hei mt-20">{{item.createtime}}</view>
</view>
</view>
<block wx:for="{{item.products}}" wx:for-item="goods" wx:for-index="goodsindex" wx:key="goodsindex" class="mt-20">
<view class="ali-z mt-10 mb-10">
<view class="sz_30 bt_hei">
<text>{{goods.productname}}</text><text hidden="{{item.code.length==0}}">({{item.code}})</text>
x<text>{{goods.goodsnum}}</text>
</view>
</view>
<view class="xian" data-jj="goodsindex" wx:if='{{index!=item.products.length-1}}'>
</view>
</block>
</view>
<view class="xian mb-30"></view>
<view class="ali-z sz_30 bt_hei">
<view class="flex1">备注:{{item.remark||''}}</view>
<view class="ml-20">合计:¥{{item.total}}</view>
</view>
<view class="xian mt-30 mb-30"></view>
<view class="ali-zs">
<!-- <view class="button" data-item="{{item}}" wx:if="{{item.type == 'carry' && item.delivery_type== 0 && item.nucleus==0 }}" catchtap="popupEwm">
买菜二维码
</view> -->
<block wx:for='{{item.order_operation}}' wx:for-item="action" wx:for-index="btnindex" wx:key="btnindex" wx:if="{{(item.fan_money==0.00)?true:action.name!='申请退款'}}">
<view style="background: linear-gradient(#F88057, #F64F15);color: #ffffff;border-radius: 70rpx;" class='sz_28 ml-20 {{action.class_name}}' data-shopid="{{item.shop_id}}" data-collection_time="{{item.collection_time}}" data-nucleus_code="{{item.nucleus_code}}" data-photo="{{item.photo}}" data-shopname="{{item.shop_name}}" data-orderid='{{item.order_id}}' catchtap="carryoperation" data-index="{{index}}" data-action='{{action.way}}' data-is_ld='{{item.buytype}}'>
{{action.name}}
</view>
</block>
</view>
</view>
</block>
</view>
</view>
</view>
<!-- <view wx:if="{{checkClassValue==3}}">
<van-tabs bind:change="shopingstatuschange" style="position:fixed;width:100%;top:80rpx;">
<van-tab title="全部">
按时收费京哈数据库和放大恢复肌肤光滑按双方互换的发掘纺纱机
</van-tab>
<van-tab title="已提货"></van-tab>
<van-tab title="未提货"></van-tab>
<van-tab title="取消提货"></van-tab>
</van-tabs>
</view> -->
<!-- 弹窗组件 -->
<!-- 弹窗组件 -->
<mp-dialog show="{{showpop}}">
<view style="height:830rpx;width:630rpx;position: relative;">
<image src="{{clientImgPath}}/images/images/background.png"></image>
<view style="position:absolute;top: 0;left:0;width:100%">
<view style="text-align: center;font-size: 72rpx;width: 90%;border-bottom: 1px dashed gray;padding: 30rpx 0;margin: 0 auto;">取货码</view>
<view style="text-align: center;color: #000000;font-size: 34rpx;padding: 20rpx 0 0 0;">请向团长展示取货码</view>
<view class="evmimg" style="width: 200px;height: 200px;margin: 0 auto;">
<!-- <canvas style="width: 108px; height: 108px" canvas-id="myQrcode"></canvas> -->
<image src="{{staticUrl}}{{ewmUrl}}" ></image>
</view>
<view style="text-align: center;font-size: 24rpx;color: #F64F15;">{{collection_time}}后可提货</view>
</view>
</view>
<view style="width:60rpx;height:60rpx;margin: 18rpx auto;" catchtap="close">
<image src="{{clientImgPath}}/images/zeroActivity/cuo.png"></image>
</view>
</mp-dialog>
<login hidden="{{hidden}}" bind:setUserInfo="setUserInfo" />
\ No newline at end of file
/* pages/order/order.wxss */
/* pages/shop//order/weidianorder/weidianLine_list_user/weidianLine_list_user.wxss */
page {
position: relative;
padding-top: 80rpx;
background: #F5F5F5;
}
.cFF69{
color: #FF6900;
}
.checkClassCss {
position: fixed;
top: 0;
display: flex;
justify-content: space-between;
width: 100%;
height: 43px;
align-items: center;
background: #fff;
}
.checkAnother {
text-align: center;
flex: 1;
}
.Classactivie {
color: #f64f15;
font-weight: bold;
}
.xiabia {
width: 50%;
height: 5rpx;
background: rgba(85, 85, 85, 0);
border-radius: 5rpx;
margin: 0 auto;
}
.xiabias {
width: 50%;
height: 5rpx;
background: #f64f15;
border-radius: 5rpx;
margin: 0 auto;
}
.tukjimg {
width: 100rpx;
height: 100rpx;
}
/* tap */
.tab_wrap {
left: 0;
top: 0;
width: 100%;
height: 80rpx;
box-sizing: border-box;
padding: 0 24rpx;
overflow: hidden;
font-size: 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
background: white;
}
.tab_wrap .activezi {
height: 55rpx;
text-align: center;
font-size: 30rpx;
font-weight: bold;
line-height: 20rpx;
color: #f64f15;
}
.activeszi {
height: 55rpx;
text-align: center;
font-size: 30rpx;
font-weight: bold;
line-height: 55rpx;
color: #555555;
}
.swiper-tab-items {
height: 55rpx;
font-size: 30rpx;
font-weight: bold;
line-height: 55rpx;
color: rgba(85, 85, 85, 1);
text-align: center;
border-bottom: 4rpx solid white;
}
.swiper-tab-ss {
height: 55rpx;
font-size: 30rpx;
font-weight: bold;
line-height: 55rpx;
text-align: center;
}
.show {
display: block;
}
.hidden {
display: none;
}
.kjx_l_t_l_text {
font-size: 55rpx;
}
.spimg {
width: 70rpx;
height: 70rpx;
border-radius: 5rpx;
}
.btnhui {
padding: 15rpx 20rpx;
box-sizing: border-box;
border: 1px solid rgba(204, 204, 204, 1);
border-radius: 5rpx;
}
.btnhong {
padding: 16rpx 30rpx;
box-sizing: border-box;
background: #f64f15;
border-radius: 5rpx;
}
.meyimg {
width: 460rpx;
height: 360rpx;
margin: 0 auto;
}
.meybox {
margin-top: 200rpx;
}
.tubiimg {
width: 27rpx;
height: 24rpx;
}
.tuimg {
width: 183rpx;
height: 183rpx;
}
view {
/* line-height: 112%; */
letter-spacing: 3rpx
}
.container {
width: 100%;
height: 100%;
}
.nav {
height: 80rpx;
width: 100%;
box-sizing: border-box;
overflow: hidden;
line-height: 80rpx;
background: #fff;
font-size: 16px;
white-space: nowrap;
position: fixed;
top: 0;
left: 0;
z-index: 99;
}
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
.nav-item {
width: 20%;
display: inline-block;
text-align: center;
}
.nav-item.active {
color: red;
}
.wullu {
text-align: center;
width: 180rpx;
margin-left: 73%;
display: inline-block;
}
/* 外卖样式 */
.tab_wrap {
top: 0;
left: 0;
width: 100%;
height: 80rpx;
box-sizing: border-box;
padding: 0 24rpx;
overflow: hidden;
font-size: 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
background: white;
}
.shuxian {
width: 1px;
height: 58rpx;
background: rgba(255, 255, 255, .4);
}
.ali-zs {
display: flex;
align-items: center;
justify-content: flex-end;
}
.tab_wrap .activezi {
height: 55rpx;
text-align: center;
font-size: 30rpx;
font-weight: bold;
line-height: 20rpx;
color: #f64f15;
/* border-bottom:4rpx solid #f64f15; */
}
.ali-zs {
display: flex;
align-items: center;
justify-content: flex-end;
}
.actives {
height: 55rpx;
text-align: center;
font-size: 30rpx;
font-weight: bold;
line-height: 55rpx;
color: #f64f15;
}
.swiper-tab-items {
height: 55rpx;
font-size: 30rpx;
font-weight: bold;
line-height: 55rpx;
color: rgba(85, 85, 85, 1);
text-align: center;
border-bottom: 4rpx solid white;
}
.swiper-tab-ss {
height: 55rpx;
font-size: 30rpx;
font-weight: bold;
line-height: 55rpx;
text-align: center;
}
.show {
display: block;
}
.hidden {
display: none;
}
.kjx_l_t_l_text {
font-size: 55rpx;
}
.spimg {
width: 70rpx;
height: 70rpx;
border-radius: 5rpx;
}
.btnhui {
padding: 10rpx 20rpx;
box-sizing: border-box;
border: 1px solid rgba(204, 204, 204, 1);
border-radius: 5rpx;
}
.btnhong {
padding: 10rpx 20rpx;
box-sizing: border-box;
background: #f64f15;
border-radius: 5rpx;
}
.meyimg {
width: 460rpx;
height: 360rpx;
margin: 0 auto;
}
.meybox {
margin-top: 200rpx;
}
.shuwuimg {
width: 67rpx;
height: 67rpx;
border-radius: 4rpx;
overflow: hidden;
}
.container {
width: 100%;
height: 100%;
}
.nav {
height: 80rpx;
width: 100%;
box-sizing: border-box;
overflow: hidden;
line-height: 80rpx;
background: #fff;
font-size: 16px;
white-space: nowrap;
position: fixed;
top: 0;
left: 0;
z-index: 99;
}
::-webkit-scrollbar {
width: 0;
height: 0;
color: transparent;
}
.nav-item {
display: inline-block;
text-align: center;
}
.nav-item.active {
color: red;
}
/* tap */
.tab_wrap {
left: 0;
top: 0;
width: 100%;
height: 80rpx;
box-sizing: border-box;
padding: 0 24rpx;
overflow: hidden;
font-size: 30rpx;
display: flex;
align-items: center;
justify-content: space-between;
background: white;
}
.itemBtn:nth-child(4n) {
margin-right: 0 !important;
}
.button {
height: 62rpx;
line-height: 62rpx;
text-align: center;
background: #f64f15 !important;
font-size: 32rpx;
font-weight: 500;
color: rgba(255, 255, 255, 1);
width: 40%;
border-radius: 10rpx;
}
.evmimg {
width: auto;
height: auto;
display: flex;
justify-content: center;
padding: 10rpx;
background-color: #fff;
margin-top: 40rpx;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment