Commit 8c1e478e authored by xieyishang's avatar xieyishang

‘addxx

parent d0a51525
{
"pages": [
"pages/lmping/user/user",
"pages/lmping/home/home",
"pages/lmping/user/user",
"pages/lmping/hometwo/hometwo",
"pages/lmping/signin/signin",
"pages/lmping/order/order",
"pages/lmping/myfans/myfans",
"pages/lmping/pushcard/pushcard",
"pages/lmping/lmvallog/lmvallog",
"pages/lmping/profitlog/profitlog",
"pages/lmping/rechargelog/rechargelog",
"pages/lmping/activitydescri/activitydescri",
"pages/address_list/address_list",
"pages/pay/pay",
"pages/webview/webview"
"pages/webview/webview",
"pages/order/order",
"pages/new_address/new_address"
],
"subpackages": [
{
"root": "pages/shop/",
"pages": [
"shops/weidian/ping_details/ping_details"
]
}
],
......@@ -36,7 +36,6 @@
"borderStyle": "white",
"backgroundColor": "#fafafa",
"list": [
{
"pagePath": "pages/lmping/home/home",
"text": "拼团",
......
This diff is collapsed.
{
"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
This diff is collapsed.
// 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
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{
"usingComponents": {}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
{
"component": true,
"usingComponents": {
"canvasdrawer": "/components/canvasdrawer/canvasdrawer"
}
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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