This commit is contained in:
liu 2023-03-24 11:24:28 +08:00
parent 9630dd8403
commit 396f5f32d5
818 changed files with 71060 additions and 0 deletions

View File

@ -0,0 +1,170 @@
module.exports =
/******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;
/******/ }
/******/ // Create a new module (and put it into the cache)
/******/ var module = installedModules[moduleId] = {
/******/ i: moduleId,
/******/ l: false,
/******/ exports: {}
/******/ };
/******/
/******/ // Execute the module function
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
/******/
/******/ // Flag the module as loaded
/******/ module.l = true;
/******/
/******/ // Return the exports of the module
/******/ return module.exports;
/******/ }
/******/
/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = modules;
/******/
/******/ // expose the module cache
/******/ __webpack_require__.c = installedModules;
/******/
/******/ // define getter function for harmony exports
/******/ __webpack_require__.d = function(exports, name, getter) {
/******/ if(!__webpack_require__.o(exports, name)) {
/******/ Object.defineProperty(exports, name, { enumerable: true, get: getter });
/******/ }
/******/ };
/******/
/******/ // define __esModule on exports
/******/ __webpack_require__.r = function(exports) {
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/******/ }
/******/ Object.defineProperty(exports, '__esModule', { value: true });
/******/ };
/******/
/******/ // create a fake namespace object
/******/ // mode & 1: value is a module id, require it
/******/ // mode & 2: merge all properties of value into the ns
/******/ // mode & 4: return value when already ns object
/******/ // mode & 8|1: behave like require
/******/ __webpack_require__.t = function(value, mode) {
/******/ if(mode & 1) value = __webpack_require__(value);
/******/ if(mode & 8) return value;
/******/ if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
/******/ var ns = Object.create(null);
/******/ __webpack_require__.r(ns);
/******/ Object.defineProperty(ns, 'default', { enumerable: true, value: value });
/******/ if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
/******/ return ns;
/******/ };
/******/
/******/ // getDefaultExport function for compatibility with non-harmony modules
/******/ __webpack_require__.n = function(module) {
/******/ var getter = module && module.__esModule ?
/******/ function getDefault() { return module['default']; } :
/******/ function getModuleExports() { return module; };
/******/ __webpack_require__.d(getter, 'a', getter);
/******/ return getter;
/******/ };
/******/
/******/ // Object.prototype.hasOwnProperty.call
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
/******/
/******/ // __webpack_public_path__
/******/ __webpack_require__.p = "";
/******/
/******/
/******/ // Load entry module and return exports
/******/ return __webpack_require__(__webpack_require__.s = 1);
/******/ })
/************************************************************************/
/******/ ([
/* 0 */,
/* 1 */
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Component({
options: {
multipleSlots: true,
addGlobalClass: true
},
properties: {
title: {
type: String,
value: ''
},
showCancel: {
type: Boolean,
value: true
},
cancelText: {
type: String,
value: '取消'
},
maskClass: {
type: String,
value: ''
},
extClass: {
type: String,
value: ''
},
maskClosable: {
type: Boolean,
value: true
},
mask: {
type: Boolean,
value: true
},
show: {
type: Boolean,
value: false
},
actions: {
type: Array,
value: [],
observer: '_groupChange'
}
},
methods: {
_groupChange: function _groupChange(e) {
if (e.length > 0 && typeof e[0] !== 'string' && !(e[0] instanceof Array)) {
this.setData({
actions: [this.data.actions]
});
}
},
buttonTap: function buttonTap(e) {
var _e$currentTarget$data = e.currentTarget.dataset,
value = _e$currentTarget$data.value,
groupindex = _e$currentTarget$data.groupindex,
index = _e$currentTarget$data.index;
this.triggerEvent('actiontap', { value: value, groupindex: groupindex, index: index });
},
closeActionSheet: function closeActionSheet(e) {
var type = e.currentTarget.dataset.type;
if (this.data.maskClosable || type) {
this.setData({
show: false
});
this.triggerEvent('close');
}
}
}
});
/***/ })
/******/ ]);

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,52 @@
<wxs module="utils">
var join = function(a,b) {
return a+b
};
var isNotSlot = function(v) {
return typeof v !== 'string'
}
module.exports = {
join: join,
isNotSlot: isNotSlot
}
</wxs>
<view wx:if="{{mask}}" class="weui-mask {{show ? '' : 'weui-mask_hidden'}} {{maskClass}}" bindtap="closeActionSheet"></view>
<view class="weui-actionsheet {{show ? 'weui-actionsheet_toggle' : ''}} {{extClass}}">
<!-- 标题 -->
<block wx:if="{{title}}">
<view class="weui-actionsheet__title">
<view class="weui-actionsheet__title-text">{{title}}</view>
</view>
</block>
<slot name="title" wx:else></slot>
<view
class="{{ !showCancel && index === actions.length-1 ? 'weui-actionsheet__action' : 'weui-actionsheet__menu' }}"
wx:key="index"
wx:for-item="actionItem"
wx:for-index="index"
wx:for="{{actions}}"
>
<block wx:if="{{utils.isNotSlot(actionItem)}}">
{{item.type}}
<block wx:for="{{actionItem}}" wx:key="value" wx:for-index="actionIndex">
<button wx:if="{{item.share}}" class="btn weui-actionsheet__cell {{item.type === 'warn' ? 'weui-actionsheet__cell_warn' : '' }}" open-type="share">{{item.text}}</button>
<view
wx:else
class="weui-actionsheet__cell {{item.type === 'warn' ? 'weui-actionsheet__cell_warn' : '' }}"
data-groupindex="{{index}}"
data-index="{{actionIndex}}"
data-value="{{item.value}}"
bindtap="buttonTap"
>
{{item.text}}
</view>
</block>
</block>
<slot name="{{actionItem}}" wx:else></slot>
</view>
<!-- 取消按钮 -->
<view class="weui-actionsheet__action" wx:if="{{showCancel}}">
<view class="weui-actionsheet__cell" data-type="close" id="iosActionsheetCancel" bindtap="closeActionSheet">{{cancelText}}</view>
</view>
</view>

View File

@ -0,0 +1,10 @@
.weui-mask{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0;background:rgba(0,0,0,0.6)}.weui-mask_transparent{position:fixed;z-index:1000;top:0;right:0;left:0;bottom:0}.weui-actionsheet{position:fixed;left:0;bottom:0;transform:translate(0, 100%);backface-visibility:hidden;z-index:5000;width:100%;background-color:#EAE7E8;transition:transform .3s;border-top-left-radius:12px;border-top-right-radius:12px;overflow:hidden}.weui-actionsheet__title{position:relative;height:56px;padding:0 24px;display:flex;justify-content:center;flex-direction:column;text-align:center;font-size:12px;color:rgba(0,0,0,0.5);line-height:1.4;background:#FFFFFF}.weui-actionsheet__title:before{content:" ";position:absolute;left:0;bottom:0;right:0;height:1px;border-bottom:1rpx solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.1)}.weui-actionsheet__title .weui-actionsheet__title-text{overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.weui-actionsheet__menu{color:rgba(0,0,0,0.9);background-color:#FFFFFF}.weui-actionsheet__action{margin-top:8px;background-color:#FFFFFF;padding-bottom:constant(safe-area-inset-bottom);padding-bottom:env(safe-area-inset-bottom)}.weui-actionsheet__cell{position:relative;padding:16px;text-align:center;font-size:17px;line-height:1.41176471}.weui-actionsheet__cell:before{content:" ";position:absolute;left:0;top:0;right:0;height:1px;border-top:1rpx solid rgba(0,0,0,0.1);color:rgba(0,0,0,0.1)}.weui-actionsheet__cell:active{background-color:#ECECEC}.weui-actionsheet__cell:first-child:before{display:none}.weui-actionsheet__cell_warn{color:#FA5151}.weui-skin_android .weui-actionsheet{position:fixed;left:50%;top:50%;bottom:auto;transform:translate(-50%, -50%);width:274px;box-sizing:border-box;backface-visibility:hidden;background:transparent;transition:transform .3s;border-radius:2px}.weui-skin_android .weui-actionsheet__action{display:none}.weui-skin_android .weui-actionsheet__menu{border-radius:2px;box-shadow:0 6px 30px 0 rgba(0,0,0,0.1)}.weui-skin_android .weui-actionsheet__cell{padding:16px;font-size:17px;line-height:1.41176471;color:rgba(0,0,0,0.9);text-align:left}.weui-skin_android .weui-actionsheet__cell:first-child{border-top-left-radius:2px;border-top-right-radius:2px}.weui-skin_android .weui-actionsheet__cell:last-child{border-bottom-left-radius:2px;border-bottom-right-radius:2px}.weui-actionsheet_toggle{transform:translate(0, 0)}.weui-mask.weui-mask_hidden{opacity:0;transform:scale3d(1, 1, 0)}.weui-mask{opacity:1;transform:scale3d(1, 1, 1);transition:all .3s}
.btn.weui-actionsheet__cell {
background-color: transparent;
color: inherit;
}
.btn.weui-actionsheet__cell::before {
border: 0;
}

View File

@ -0,0 +1,121 @@
// eaterplanet_ecommerce/components/ad-alert/index.js
Component({
/**
* 组件的属性列表
* pop_page 投放页面类型0商城首页1商品分类2商城购物车3商城个人中心
*/
properties: {
pop_page: {
type: Number,
value: ''
}
},
data: {
imgheights: [],//所有图片的高度
current:0,
visible: false,
adv_list: []
},
attached: function() {
// this.getData();
},
pageLifetimes: {
show: function () {
this.getData();
}
},
methods: {
getData: function(){
let token = wx.getStorageSync('token');
let pop_page = this.data.pop_page;
getApp().util.ProReq('popadv.popadv_list', {token, pop_page}).catch(res=>{
console.log(res.popadvs)
if(res.popadvs) {
let adv_list = res.popadvs.adv_list || [];
this.setData({
adv_list,
visible: adv_list.length>0
})
}
})
},
imageLoad(e){
//当图片载入完毕时
var imgwidth = e.detail.width,
imgheight = e.detail.height,
//宽高比
ratio = imgwidth / imgheight;
console.log(imgwidth, imgheight)
// 计算的高度值
var viewHeight = 600 / ratio;
var imgheight = viewHeight;
var imgheights = this.data.imgheights;
//把每一张图片的对应的高度记录到数组里
imgheights[e.target.dataset.id] = imgheight;
console.log('图片的高度:'+imgheights)
this.setData({
imgheights: imgheights
})
},
bindchange: function (e) {
// current 改变时会触发 change 事件
this.setData({ current: e.detail.current })
},
close: function() {
this.setData({ visible: false })
},
popclick: function(e){
let idx = e.currentTarget.dataset.idx;
if(idx!=='') {
let adv_list = this.data.adv_list;
let linktype = adv_list[idx].linktype;
let url = adv_list[idx].link;
let ad_id = adv_list[idx].ad_id;
if (linktype == 0) {
// 跳转webview
wx.navigateTo({
url: '/eaterplanet_ecommerce/pages/web-view?url=' + encodeURIComponent(url),
})
} else if (linktype == 1) {
let tabUrls = ['/eaterplanet_ecommerce/pages/index/index', '/eaterplanet_ecommerce/pages/order/shopCart', '/eaterplanet_ecommerce/pages/user/me', '/eaterplanet_ecommerce/pages/type/index'];
if (tabUrls.indexOf(url) != -1) {
url && wx.switchTab({ url: url })
} else {
url && wx.navigateTo({ url: url })
}
} else if (linktype == 2) {
// 跳转小程序
let appId = adv_list[idx].appid;
appId && wx.navigateToMiniProgram({
appId,
path: url,
extraData: {},
envVersion: 'release',
success(res) {
console.log(`弹窗广告:打开外链 appId:${appId} url:${url} 成功`)
},
fail(error) {
console.log(`弹窗广告:打开外链 appId:${appId} url:${url} 失败`)
console.log('失败原因:' + error.errMsg)
if(error.errMsg == 'navigateToMiniProgram:fail invalid appid') {
wx.showToast({
icon: 'none',
title: 'appid验证失败请检查',
})
}
}
})
}
//添加点击量
this.addview(ad_id);
}
},
addview: function(id){
getApp().util.ProReq('popadv.popadv_click', {id})
}
}
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,16 @@
<view class="fixed" wx:if="{{visible&&adv_list.length>0}}">
<view class="mask" bindtap="close"></view>
<view class="cont">
<image wx:if="{{adv_list.length==1}}" class="img" mode="widthFix" src="{{adv_list[0].thumb}}" bindtap="popclick" data-idx='0'></image>
<swiper wx:else class="swiper" bindchange="bindchange" style="height:{{imgheights[current]}}rpx;" indicator-dots="true" autoplay="true" interval="3000" duration="500" indicator-active-color="#FFFFFF">
<block wx:for="{{adv_list}}" wx:key="id">
<swiper-item bindtap="popclick" data-idx='{{index}}'>
<image class="img" bindload="imageLoad" data-id='{{index}}' mode="widthFix" src="{{item.thumb}}"></image>
</swiper-item>
</block>
</swiper>
</view>
<view class="close">
<image class="close-img" src="../../images/closePoster.png" bindtap="close"></image>
</view>
</view>

View File

@ -0,0 +1,40 @@
.fixed {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 1000;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.mask {
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
background: rgba(0, 0, 0, 0.6);
}
.cont {
z-index: 1001;
width: 80%;
}
.cont .img {
width: 100%;
}
.close-img {
margin-top: 40rpx;
width: 60rpx;
height: 60rpx;
}
.swiper {
width: 100%;
}

View File

@ -0,0 +1,18 @@
Component({
externalClasses: ['i-class'],
properties: {
fontsize: {
type: Number,
value: 24
}
},
data: {
skin: getApp().globalData.skin,
},
attached(){
this.setData({
skin: getApp().globalData.skin,
})
}
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,3 @@
<view class="btn i-class" style="background: linear-gradient(to top, {{skin.color}}, {{skin.light}});">
<text class="iconfont icon-gouwuche" style="color:#fff;font-size:{{fontsize}}rpx;"></text>
</view>

View File

@ -0,0 +1,11 @@
@import "/icon.wxss";
.btn {
width: 60rpx;
height: 60rpx;
border-radius: 50%;
background: linear-gradient(to top, #ff5345, #ff8379);
display: flex!important;
align-items: center;
justify-content: center;
}

View File

@ -0,0 +1,108 @@
Component({
properties: {
pos: {
type: String,
value: 0
}
},
data: {
info: '',
ishow: false
},
attached: function(){
this.getData();
},
pageLifetimes: {
show: function() {
console.log('pageLifetimes')
this.getData();
}
},
methods: {
getData: function() {
let that = this;
getApp().util.request({
url: 'entry/wxapp/index',
data: {
controller: 'index.get_advimg'
},
dataType: 'json',
success: function (res) {
if(res.data.code==0) {
let info = res.data.data;
let pos = info.pos || [];
let ishow = pos.includes(that.data.pos);
that.setData({ info, ishow })
} else {
that.setData({ ishow: false })
}
}
})
},
goNav: function(){
let info = this.data.info;
let type = info.linktype;
let url = info.link;
if (type == 0) {
// 跳转webview
wx.navigateTo({
url: '/eaterplanet_ecommerce/pages/web-view?url=' + encodeURIComponent(url),
})
} else if (type == 1) {
if (url.indexOf('eaterplanet_ecommerce/pages/index/index') != -1 || url.indexOf('eaterplanet_ecommerce/pages/order/shopCart') != -1 || url.indexOf('eaterplanet_ecommerce/pages/user/me') != -1 || url.indexOf('eaterplanet_ecommerce/pages/type/index') != -1) {
url && wx.switchTab({ url })
} else {
url && wx.navigateTo({ url })
}
} else if (type == 2) {
// 跳转小程序
let appId = info.appid;
appId && wx.navigateToMiniProgram({
appId,
path: url,
extraData: {},
envVersion: 'release',
success(res) {
// 打开成功
},
fail(error) {
console.log(error)
}
})
} else if (type == 3) {
if(this.data.pos==0) {
this.triggerEvent("switchType", url);
} else {
getApp().globalData.indexCateId = url;
wx.switchTab({
url: '/eaterplanet_ecommerce/pages/index/index'
})
}
} else if (type == 4) {
//独立分类
getApp().globalData.typeCateId = url;
wx.switchTab({
url: '/eaterplanet_ecommerce/pages/type/index'
})
}else if (type==5){
// 跳转小程序
let appId = info.appid;
appId && wx.navigateToMiniProgram({
appId,
path: url,
extraData: {},
envVersion: 'release',
success(res) {
// 打开成功
},
fail(error) {
console.log(error)
}
})
}
}
}
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,6 @@
<view class="wrap" wx:if="{{info&&ishow}}">
<button class="contact" openType="contact" wx:if="{{info.linktype==5}}">
<image class="img" src="{{info.thumb}}" mode="widthFix"></image>
</button>
<image bindtap="goNav" class="img" src="{{info.thumb}}" mode="widthFix" wx:else></image>
</view>

View File

@ -0,0 +1,24 @@
.wrap {
padding: 0 20rpx;
margin: 10rpx 0;
filter: drop-shadow(0 10rpx 15rpx rgb(0, 0, 0, 0.4));
}
.wrap .img {
width: 100%;
border-radius: 20rpx;
}
.contact {
font-size: inherit;
line-height: inherit;
border-radius: 0;
background: transparent;
color: inherit;
padding: 0;
}
.contact::after {
content: none;
}

View File

@ -0,0 +1,29 @@
// eaterplanet_ecommerce/components/cartBtn/index.js
Component({
externalClasses: ["i-class", "i-icon"],
properties: {
showHome: {
type: Boolean,
value: false
},
showShare: {
type: Boolean,
value: false
},
showContact: {
type: Boolean,
value: false
},
cartNum: {
type: Number,
value: 0
}
},
methods: {
goLink: function (e) {
let url = e.currentTarget.dataset.link;
wx.switchTab({ url })
}
}
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,14 @@
<view class="cart-btn i-class">
<button class="icon btn" open-type="share" wx:if="{{showShare}}">
<text class="iconfont icon-fenxiang"></text>
<view class="name">分享</view>
</button>
<button class="icon btn" openType="contact" wx:if="{{showContact}}">
<text class="iconfont icon-kefu"></text>
<view class="name">客服</view>
</button>
<view class="icon none-btn" bindtap="goLink" data-link="/eaterplanet_ecommerce/pages/index/index" wx:if="{{showHome}}">
<text class="iconfont icon-shouye"></text>
<view class="name">首页</view>
</view>
</view>

View File

@ -0,0 +1,59 @@
@import "../../../icon.wxss";
.cart-btn {
position: fixed;
right: 0rpx;
bottom: 40%;
z-index: 100;
}
.cart-btn .icon {
position: relative;
margin-bottom: 20rpx;
right: 0rpx;
width: 70rpx;
height: 100rpx;
background: #4facfe86;
border-radius: 30rpx 0rpx 0rpx 30rpx;
text-align: center;
color: #fff;
box-sizing: border-box;
font-size: 20rpx;
padding: 10rpx;
line-height: 1.4;
z-index: 100;
}
.cart-btn .btn.icon {
line-height: 1.5;
z-index: 100;
}
.cart-btn .iconfont {
font-size: 30rpx;
color: #fff;
}
.cart-btn .none-btn.icon .iconfont {
font-size: 35rpx;
}
.cart-btn .none-btn.icon .name {
margin-top: -3rpx;
}
.button::after {
width: 200%;
height: 200%;
position: absolute;
top: 0;
left: 0;
border: 0px solid rgba(0,0,0,.2);
-webkit-transform: scale(.5);
transform: scale(.5);
-webkit-transform-origin: 0 0;
transform-origin: 0 0;
box-sizing: border-box;
border-radius: 10px;
}

View File

@ -0,0 +1,144 @@
var util = require('../../utils/util.js');
var wcache = require('../../utils/wcache.js');
var app = getApp();
var flag = true;
Component({
properties: {
needAuth: {
type: Boolean,
value: false
},
needPosition: {
type: Boolean,
value: true
},
navBackUrl: {
type: String,
value: '',
observer: function (t) {
if (t) app.globalData.navBackUrl = t;
}
}
},
data: {
btnLoading: false,
isIpx: false,
auth_bg: '',
loaded: false
},
attached: function() {
this.getBg();
app.globalData.isIpx && this.setData({
isIpx: true
});
},
methods: {
getBg: function(){
let that = this;
let auth_bg = wcache.get('auth_bg', false);
if (!auth_bg){
app.util.request({
'url': 'entry/wxapp/index',
'data': {
controller: 'index.get_auth_bg'
},
dataType: 'json',
success: function (res) {
that.setData({ loaded: true })
if (res.data.code == 0) {
wcache.put('auth_bg', res.data.data, 600);
res.data.data && that.setData({ auth_bg: res.data.data })
}
}
})
} else {
that.setData({ auth_bg, loaded: true })
}
},
bindGetUserInfo: function (t) {
var that = this;
if (!this.data.btnLoading) {
wx.getUserProfile({
desc: "获取你的昵称、头像、地区及性别",
success: function (msg) {
var userInfo = msg.userInfo
wx.setStorage({
key: "userInfo",
data: userInfo
})
that.setData({ btnLoading: true });
util.login_prosime(that.data.needPosition, userInfo).then(function () {
console.log("授权成功")
that.setData({ btnLoading: false });
wx.showToast({
title: '登录成功',
icon: 'success',
duration: 2000
})
that.triggerEvent("authSuccess");
app.globalData.changedCommunity = true;
//检查获取位置权限
that.data.needPosition && location.getGps();
}).catch(function () {
that.triggerEvent("cancel");
console.log('授权失败');
})
},
fail: ()=>{
wx.showToast({
title: "授权失败,为了完整体验,获取更多优惠活动,需要您的授权。",
icon: "none"
});
that.triggerEvent("cancel");
that.setData({ btnLoading: false });
}
})
}
},
bindGetUserInfoTwo: function (t) {
var that = this;
wx.showLoading({ title: '授权中' });
if (flag) {
flag = false;
var n = t.detail;
if ("getUserInfo:ok" === n.errMsg) {
util.login_prosime().then(function () {
console.log("授权成功")
wx.hideLoading();
flag = true;
wx.showToast({
title: '登录成功',
icon: 'success',
duration: 2000
})
that.triggerEvent("authSuccess");
}).catch(function () {
flag = true;
wx.hideLoading();
console.log('授权失败')
})
} else {
wx.hideLoading();
wx.showToast({
title: "授权失败,为了完整体验,获取更多优惠活动,需要您的授权。",
icon: "none"
});
flag = true;
}
}
}
// openSetting: function () {
// location.openSetting().then(function (t) {
// app.globalData.location = {
// lat: t.latitude,
// lng: t.longitude
// };
// app.globalData.community.communityId || wx.redirectTo({
// url: "/eaterplanet_ecommerce/pages/position/communities"
// });
// app.globalData.canGetGPS = true;
// });
// }
}
});

View File

@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"i-button": "../button/index",
"i-router-link": "../router-link/router-link"
}
}

View File

@ -0,0 +1,14 @@
<view class="wrap" wx:if="{{needAuth&&loaded}}">
<button bindgetuserinfo="bindGetUserInfoTwo" openType="getUserInfo" class='auth_bg' wx:if="{{auth_bg}}" style='background: url({{auth_bg}}) no-repeat top center;background-size: cover;'></button>
<block wx:else>
<image class='auth-login' mode='widthFix' src="../../images/login.png"></image>
<view class='line1'>我们的小程序将获取您的以下权限:</view>
<view class='line2'>·获取您的公开信息(昵称和头像等)</view>
<view class='line3'>(如未授权,可能无法正常使用该小程序)</view>
<i-button bindgetuserinfo="bindGetUserInfo" iClass="confirm" loading="{{btnLoading}}" openType="getUserInfo" wx:if="canIUse">确认授权</i-button>
<view class="updateWx" wx:else>请升级微信版本</view>
</block>
</view>
<view class="container {{isIpx?'pb20 mb20':''}}" wx:else>
<slot></slot>
</view>

View File

@ -0,0 +1,61 @@
.mb20 {
margin-bottom: 40rpx;
}
.wrap {
position: fixed;
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
}
.wrap .auth-login {
margin: 100rpx 0 50rpx;
width: 550rpx;
}
.auth_bg {
width: 100%;
height: 100%;
border-radius: 0;
}
.auth_bg::after {
border: 0;
}
.wrap .line1 {
line-height: 50rpx;
color: #333;
font-size: 30rpx;
}
.wrap .line2 {
line-height: 50rpx;
color: #999;
font-size: 26rpx;
}
.wrap .line3 {
line-height: 50rpx;
color: #333;
font-size: 24rpx;
}
.wrap .confirm {
width: 500rpx;
height: 90rpx;
line-height: 90rpx;
margin-top: 40rpx;
background: #4facfe;
color: #fff;
border-radius: 10rpx;
font-size: 34rpx;
margin-bottom: 40%;
}
.button-hover {
opacity: 0.8;
}

View File

@ -0,0 +1,318 @@
var t = require("../../utils/public");
var util = require('../../utils/util.js');
var status = require('../../utils/index.js');
var app = getApp();
module.exports = Behavior({
properties: {
spuItem: {
type: Object,
value: {
spuId: "",
skuId: "",
spuImage: "",
spuName: "",
endTime: 0,
beginTime: "",
actPrice: ["", ""],
marketPrice: ["", ""],
spuCanBuyNum: "",
soldNum: "",
actId: "",
limitMemberNum: "",
limitOrderNum: "",
serverTime: "",
isLimit: false,
skuList: [],
spuDescribe: "",
is_take_fullreduction: 0,
label_info: "",
car_count: 0
},
observer: function (t) {
let url = `/eaterplanet_ecommerce/pages/goods/goodsDetail?id=${t.actId}`;
// if (t && t.is_video) url = `/eaterplanet_ecommerce/moduleA/video/detail?&id=${t.actId}`;
this.setData({ url });
}
},
isPast: {
type: Boolean,
value: false
},
actEnd: {
type: Boolean,
value: false
},
reduction: {
type: Object,
value: {
full_money: '',
full_reducemoney: '',
is_open_fullreduction: 0
}
},
isShowListCount: {
type: Number,
value: 0
},
changeCarCount: {
type: Boolean,
value: false,
observer: function (t) {
if (t) this.setData({ number: this.data.spuItem.car_count || 0 });
}
},
needAuth: {
type: Boolean,
value: false
},
is_open_vipcard_buy: {
type: Number,
value: 0
},
canLevelBuy: {
type: Boolean,
value: false
},
isShowListTimer: {
type: Boolean,
value: true
},
showPickTime: {
type: Boolean,
value: false
},
skin: {
type: Object
},
saleUnit: {
type: String
},
width250: {
type: Boolean,
value: false
},
diyInfo: {
type: Object,
value: {
goodsTag: 'default'
}
}
},
attached() {
this.setData({ placeholdeImg: app.globalData.placeholdeImg})
},
data: {
disabled: false,
placeholdeImg: '',
number: 0,
url: '',
canClick: true
},
ready: function () {
this.setData({
number: this.data.spuItem.car_count || 0
});
},
methods: {
openSku: function() {
if (this.data.needAuth) {
this.triggerEvent("authModal", true);
return;
}
console.log( 'step1');
this.setData({
stopClick:true,
disabled:false
})
let spuItem = this.data.spuItem;
if (this.data.spuItem.skuList.length === void 0) {
this.triggerEvent("openSku", {
actId:spuItem.actId,
skuList: spuItem.skuList,
promotionDTO: spuItem.promotionDTO,
is_take_vipcard: spuItem.is_take_vipcard,
is_mb_level_buy: spuItem.is_mb_level_buy,
allData: {
spuName: spuItem.spuName,
skuImage: spuItem.skuImage,
actPrice: spuItem.actPrice,
canBuyNum: spuItem.spuCanBuyNum,
stock: spuItem.spuCanBuyNum,
marketPrice: spuItem.marketPrice,
oneday_limit_count: spuItem.oneday_limit_count,
total_limit_count: spuItem.total_limit_count,
one_limit_count: spuItem.one_limit_count,
goods_start_count: spuItem.goods_start_count
}
});
} else {
this.addCart({ value: 1, type: "plus" });
}
},
countDownEnd: function() {
this.setData({
actEnd: true
});
},
submit2: function(e) {
(0, t.collectFormIds)(e.detail.formId);
},
changeNumber: function (t) {
var e = t.detail;
e && this.addCart(e);
},
outOfMax: function (t) {
var e = t.detail;
let { spuCanBuyNum, one_limit_count } = this.data.spuItem;
let canBuyNum = spuCanBuyNum<one_limit_count ? spuCanBuyNum: one_limit_count;
if(this.data.number >= canBuyNum) {
wx.showToast({
title: "不能购买更多啦",
icon: "none"
})
}
},
addCart: function (t) {
// {value: 2, type: "plus/minus"}
var token = wx.getStorageSync('token');
var community = wx.getStorageSync('community');
let spuItem = this.data.spuItem;
var goods_id = spuItem.actId;
var community_id = community.communityId;
let { car_count, goods_start_count } = spuItem;
let quantity = 1;
let number = this.data.number || 0;
let that = this;
if (t.type =='plus'){
if(number<goods_start_count) {
quantity = goods_start_count-number;
}
let data = {
goods_id,
community_id,
quantity,
sku_str: '',
buy_type: 'dan',
pin_id: 0,
is_just_addcar: 1
}
util.addCart(data).then(res=>{
if(res.showVipModal==1) {
let { pop_vipmember_buyimage } = res.data;
that.triggerEvent("vipModal", { pop_vipmember_buyimage, showVipModal: true, visible: false });
} else {
if (res.data.code == 3) {
let max_quantity = res.data.max_quantity || '';
(max_quantity > 0) && that.setData({ number: that.data.number })
wx.showToast({
title: res.data.msg,
icon: 'none',
duration: 2000
})
} else if (res.data.code == 4) {
that.setData({ needAuth: true })
that.triggerEvent("authModal", true);
} else if (res.data.code == 6 || res.data.code == 7) {
let max_quantity = res.data.max_quantity || '';
(max_quantity > 0) && that.setData({ number: that.data.number })
var msg = res.data.msg;
wx.showToast({
title: msg,
icon: 'none',
duration: 2000
})
} else {
that.triggerEvent("changeCartNum", res.data.total);
that.setData({ number: res.data.cur_count })
wx.showToast({
title: "已加入购物车",
image: "../../images/addShopCart.png"
})
status.indexListCarCount(goods_id, res.data.cur_count);
}
}
})
} else {
console.log('goods_start_count',goods_start_count)
console.log('number',number)
if(number<=goods_start_count) {
quantity = number;
}
app.util.request({
url: 'entry/wxapp/user',
data: {
controller: 'car.reduce_car_goods',
token: token,
goods_id: goods_id,
community_id: community_id,
quantity,
sku_str: '',
buy_type: 'dan',
pin_id: 0,
is_just_addcar: 1
},
dataType: 'json',
method: 'POST',
success: function (res) {
if (res.data.code == 3) {
wx.showToast({
title: res.data.msg,
icon: 'none',
duration: 2000
})
} else if (res.data.code == 4) {
if (that.data.needAuth) {
that.setData({ needAuth: true })
that.triggerEvent("authModal", true);
return;
}
} else {
that.triggerEvent("changeCartNum", res.data.total);
that.setData({ number: res.data.cur_count })
status.indexListCarCount(goods_id, res.data.cur_count);
}
}
})
}
},
goDetails: function(t){
if(!this.data.canClick) {
return;
}
let that = this;
this.setData({
canClick: false
});
let goodsid = t.currentTarget.dataset.id || '';
let img = t.currentTarget.dataset.img || '';
let url = '/eaterplanet_ecommerce/pages/goods/goodsDetail?id='+goodsid;
util.getStorageImage(img).then(res=>{
wx.navigateTo({
url,
complete: function () {
setTimeout(function () {
that.setData({
canClick: true
});
}, 400);
}
})
}).catch(err=>{
wx.navigateTo({
url,
complete: function () {
setTimeout(function () {
that.setData({
canClick: true
});
}, 400);
}
})
});
}
}
});

View File

@ -0,0 +1,81 @@
Component({
externalClasses: ["i-class"],
properties: {
type: {
type: String,
value: ""
},
inline: {
type: Boolean,
value: false
},
size: {
type: String,
value: ""
},
shape: {
type: String,
value: "square"
},
disabled: {
type: Boolean,
value: false
},
loading: {
type: Boolean,
value: false
},
long: {
type: Boolean,
value: false
},
openType: String,
appParameter: String,
hoverStopPropagation: Boolean,
hoverStartTime: {
type: Number,
value: 20
},
hoverStayTime: {
type: Number,
value: 140
},
lang: {
type: String,
value: "en"
},
sessionFrom: {
type: String,
value: ""
},
sendMessageTitle: String,
sendMessagePath: String,
sendMessageImg: String,
showMessageCard: Boolean,
styleStr: {
type: String,
value: ""
}
},
methods: {
handleTap: function () {
return !this.data.disabled && (!this.data.loading && void this.triggerEvent("click"));
},
bindgetuserinfo: function () {
var e = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).detail, t = void 0 === e ? {} : e;
this.triggerEvent("getuserinfo", t);
},
bindcontact: function () {
var e = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).detail, t = void 0 === e ? {} : e;
this.triggerEvent("contact", t);
},
bindgetphonenumber: function () {
var e = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).detail, t = void 0 === e ? {} : e;
this.triggerEvent("getphonenumber", t);
},
binderror: function () {
var e = (arguments.length > 0 && void 0 !== arguments[0] ? arguments[0] : {}).detail, t = void 0 === e ? {} : e;
this.triggerEvent("error", t);
}
}
});

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,6 @@
<button appParameter="{{appParameter}}" bindcontact="bindcontact" binderror="binderror" bindgetphonenumber="bindgetphonenumber" bindgetuserinfo="bindgetuserinfo" catchtap="handleTap" class="i-class i-btn {{long?'i-btn-long':''}} {{'i-btn-'+size}} {{'i-btn-'+type}} {{'i-btn-'+shape}} {{loading?'i-btn-loading':''}} {{disabled?'i-btn-disabled':''}} {{inline?'i-btn-inline':''}}"
hoverClass="i-btn-hover" hoverStartTime="{{hoverStartTime}}" hoverStayTime="{{hoverStayTime}}" hoverStopPropagation="{{hoverStopPropagation}}" openType="{{openType}}" plain="true" sendMessageImg="{{sendMessageImg}}" sendMessagePath="{{sendMessagePath}}"
sendMessageTitle="{{sendMessageTitle}}" sessionFrom="{{sessionFrom}}" showMessageCard="{{showMessageCard}}" style="{{styleStr}}">
<view class="i-btn-loading-inner" wx:if="{{loading}}"></view>
<slot></slot>
</button>

View File

@ -0,0 +1,127 @@
.i-btn {
text-align: center;
vertical-align: middle;
touch-action: manipulation;
cursor: pointer;
background-image: none;
white-space: nowrap;
user-select: none;
font-size: 28rpx;
border-radius: 4rpx;
border: 0 !important;
position: relative;
text-decoration: none;
height: 88rpx;
line-height: 88rpx;
background: #f7f7f7;
color: #495060;
margin: 20rpx;
}
.i-btn-hover {
opacity: 0.7;
}
.i-btn-long {
border-radius: 0;
margin: 0;
box-shadow: none;
}
.i-btn-large {
height: 96rpx;
line-height: 96rpx;
}
.i-btn-small {
height: 80rpx;
line-height: 80rpx;
}
.i-btn-primary {
color: #fff;
background: #2d8cf0;
}
.i-btn-ghost {
background: #fff;
color: #495060;
}
.i-btn-success {
color: #fff;
background: #19be6b;
}
.i-btn-warning {
color: #fff;
background: #f90;
}
.i-btn-error {
color: #fff;
background: #ed3f14;
}
.i-btn-info {
color: #fff;
background: #2db7f5;
}
.i-btn-circle {
border-radius: 88rpx;
}
.i-btn-large.i-btn-circle {
border-radius: 96rpx;
}
.i-btn-small.i-btn-circle {
border-radius: 80rpx;
}
.i-btn-loading {
opacity: 0.6;
}
.i-btn-loading-inner {
display: inline-block;
margin-right: 24rpx;
vertical-align: middle;
width: 28rpx;
height: 28rpx;
background: 0 0;
border: 4rpx solid #e9eaec;
border-color: #e9eaec #e9eaec #e9eaec #2d8cf0;
border-radius: 50%;
animation: btn-spin 0.6s linear;
animation-iteration-count: infinite;
}
.i-btn-disabled {
opacity: 0.9;
}
.i-btn-inline {
display: inline-block;
}
@-webkit-keyframes btn-spin {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}
@keyframes btn-spin {
0% {
transform: rotate(0);
}
100% {
transform: rotate(360deg);
}
}

View File

@ -0,0 +1,7 @@
// eaterplanet_ecommerce/components/cart/index.js
Component({
options: {
multipleSlots: true
},
externalClasses: ["i-class", "i-card-header", "i-card-body", "i-card-footer"]
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,11 @@
<view class="i-class i-card">
<view class="i-card-header">
<slot name="header"></slot>
</view>
<view class="i-card-body">
<slot name="content"></slot>
</view>
<view class="i-card-footer">
<slot name="footer"></slot>
</view>
</view>

View File

@ -0,0 +1,9 @@
.i-card {
width: 710rpx;
border-radius: 20rpx;
background: #fff;
display: flex;
flex-direction: column;
overflow: hidden;
box-shadow: 10rpx 10rpx 20rpx 0rpx #afafafa1;
}

View File

@ -0,0 +1,21 @@
// eaterplanet_ecommerce/components/fixed-cart/index.js
Component({
externalClasses: ["i-class"],
properties: {
cartNum: {
type: Number,
default: 0
}
},
/**
* 组件的方法列表
*/
methods: {
goCart: function () {
wx.switchTab({
url: '/eaterplanet_ecommerce/pages/order/shopCart',
})
}
}
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,5 @@
<view class="cart i-class" bindtap="goCart">
<image class="img" src="../../images/icon-tab-shop1.png"></image>
<text>购物车</text>
<text class="num" wx:if="{{cartNum>0}}">{{cartNum}}</text>
</view>

View File

@ -0,0 +1,37 @@
.cart {
position: fixed;
left: 0rpx;
bottom: 80rpx;
width: 160rpx;
height: 100rpx;
border-radius: 0rpx 30rpx 30rpx 0rpx;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
line-height: 1.5;
font-size: 24rpx;
background: #4facfe86;
backdrop-filter: blur(40rpx);
color: #fff;
/**box-shadow: 0 0 15rpx rgba(0,0,0,0.2);**/
}
.cart .img {
width: 54rpx;
height: 54rpx;
}
.cart .num {
color: #fff;
background-color: #4facfe;
position: absolute;
top: -15rpx;
right: -15rpx;
min-width: 54rpx;
height: 54rpx;
line-height: 54rpx;
border-radius: 54rpx;
text-align: center;
font-size: 26rpx;
}

View File

@ -0,0 +1,40 @@
// eaterplanet_ecommerce/components/cashon_delivery/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
paymentCode: {
type: String,
value: ""
},
codeImg: {
type: String,
value: ""
}
},
/**
* 组件的初始数据
*/
data: {
showTipDialog: false,
showImgDialog: false
},
/**
* 组件的方法列表
*/
methods: {
handleTipDialog() {
this.setData({
showTipDialog: !this.data.showTipDialog
})
},
handleImgDialog() {
this.setData({
showImgDialog: !this.data.showImgDialog
})
}
}
})

View File

@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"i-modal": "../modal/index"
}
}

View File

@ -0,0 +1,25 @@
<view class="i-flex" wx:if="{{paymentCode=='cashon_delivery'}}">
<view class="blue u-font-24 u-m-r-10" wx:if="{{codeImg}}" bindtap="handleImgDialog">出示收款码</view>
<view class="blue u-font-24 u-m-r-10" wx:else>暂无收款码,请线下收款</view>
<text class="iconfont icon-shuoming text-dark fsz-28" bindtap="handleTipDialog"></text>
</view>
<i-modal scrollUp="{{false}}" visible="{{showTipDialog}}">
<view class="rule-modal bg-f w90p rounded">
<view class="fsz-30 weight border-bottom text-center py10">收款码</view>
<view class="p15 border-bottom fsz-28 line-height">
该订单为 “货到付款” 支付方式,用户订单签收的时候请出示“收款码”进行收款,或者其他方式收款,提前沟通确认,防止订单出错。
</view>
<view class="fsz-30 bule text-center py10" bindtap="handleTipDialog">知道了</view>
</view>
</i-modal>
<i-modal scrollUp="{{false}}" visible="{{showImgDialog}}">
<view class="rule-modal bg-f w90p rounded">
<view class="fsz-30 weight border-bottom text-center py10">收款码</view>
<view class="p15 border-bottom fsz-28 line-height text-center">
<image src="{{codeImg}}" style="width: 480rpx;height:480rpx;"></image>
</view>
<view class="fsz-30 bule text-center py10" bindtap="handleImgDialog">关闭</view>
</view>
</i-modal>

View File

@ -0,0 +1,2 @@
@import "../../../common.wxss";
@import "../../../icon.wxss";

View File

@ -0,0 +1,85 @@
Component({
properties: {
changeCommunity: {
type: Object,
value: {}
},
community: {
type: Object,
value: {}
},
visible: {
type: Boolean,
value: false
},
canChange: {
type: Boolean,
value: true
},
groupInfo: {
type: Object,
value: {
group_name: '社区',
owner_name: '团长'
}
},
cancelFn: {
type: Boolean,
value: false
}
},
attached() {
this.countDistance()
},
methods: {
countDistance: function () {
let that = this;
wx.getLocation({
type: 'wgs84',
success(res) {
let {changeCommunity, community} = that.data;
const latitude = res.latitude;
const longitude = res.longitude;
let lat1 = community.lat || '';
let lon1 = community.lon || '';
let lat2 = changeCommunity.lat || '';
let lon2 = community.lon || '';
if(lat1 && lon1 && lat2 && lon2) {
let distance1 = that.getDistance(latitude, longitude, lat1, lon1);
let distance2 = that.getDistance(latitude, longitude, lat2, lon2);
community.distance = "距您"+distance1.toFixed(2)+"km";
changeCommunity.distance = "距您"+distance2.toFixed(2)+"km";
that.setData({ community, changeCommunity })
}
}
})
},
getDistance: function (lat1, lng1, lat2, lng2) {
var radLat1 = lat1 * Math.PI / 180.0;
var radLat2 = lat2 * Math.PI / 180.0;
var a = radLat1 - radLat2;
var b = lng1 * Math.PI / 180.0 - lng2 * Math.PI / 180.0;
var s = 2 * Math.asin(Math.sqrt(Math.pow(Math.sin(a / 2), 2) +
Math.cos(radLat1) * Math.cos(radLat2) * Math.pow(Math.sin(b / 2), 2)));
s = s * 6378.137;
s = Math.round(s * 10000) / 10000;
return s;
},
switchCommunity: function (e) {
let type = e.currentTarget.dataset.type;
if (type == 0 || !this.data.canChange) {
this.closeModal();
} else {
this.data.canChange && this.triggerEvent('changeComunity'), getApp().globalData.goodsListCarCount = [];
}
},
closeModal: function () {
this.data.cancelFn && this.triggerEvent('noChange');
this.setData({
visible: false
})
}
}
})

View File

@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"i-modal": "../modal/index"
}
}

View File

@ -0,0 +1,39 @@
<!-- 小区确认begin -->
<i-modal scrollUp="{{false}}" visible="{{visible&&canChange}}">
<view class="community-box">
<view class="community-content">
<view class="community-content-title">
分享{{groupInfo.owner_name}}与当前{{groupInfo.owner_name}}不一致,<block wx:if="{{canChange}}">请选择</block><block wx:else>因为设置无法切换{{groupInfo.owner_name}},所以仍绑定之前{{groupInfo.owner_name}}。</block>
</view>
<view class="community-content-tip">
<view class="item" bindtap="switchCommunity" data-type="1">
<view class="item-l">
<image class="img" src="{{changeCommunity.disUserHeadImg}}"></image>
<view class="type">分享{{groupInfo.owner_name}}</view>
</view>
<view class="item-r">
<view class="name">{{changeCommunity.communityName}} <text wx:if="{{changeCommunity.distance}}" class="distance">{{changeCommunity.distance}}</text></view>
<view class="address">{{changeCommunity.fullAddress}}</view>
</view>
<view class="item-ft">
<image mode="widthFix" class="img" src="../../images/community-right-arrow.png"></image>
</view>
</view>
<view class="item" bindtap="switchCommunity" data-type="0" wx:if="{{community&&community.communityName}}">
<view class="item-l">
<image class="img" src="{{community.disUserHeadImg}}"></image>
<view class="type green">原{{groupInfo.owner_name}}</view>
</view>
<view class="item-r">
<view class="name">{{community.communityName}} <text class="distance" wx:if="{{community.distance}}">{{community.distance}}</text></view>
<view class="address">{{community.fullAddress}}</view>
</view>
<view class="item-ft">
<image mode="widthFix" class="img" src="../../images/community-right-arrow.png"></image>
</view>
</view>
</view>
</view>
</view>
</i-modal>
<!-- 小区确认end -->

View File

@ -0,0 +1,112 @@
.community-box {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.community-content {
width: 620rpx;
background: #fff;
border-radius: 10rpx;
position: relative;
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
margin: 30px auto;
overflow: hidden;
z-index: 1001;
}
.community-content-title {
position: relative;
font-size: 30rpx;
width: 100%;
box-sizing: border-box;
text-align: center;
padding: 20rpx;
}
.community-content-change {
color: #4facfe;
margin-left: 15rpx;
}
.community-content-tip {
color: #666;
font-size: 32rpx;
line-height: 1.6;
padding: 20rpx;
}
.community-content-tip .item {
border: 1rpx solid #ccc;
padding: 10rpx;
margin-bottom: 20rpx;
border-radius: 10rpx;
}
.community-content-tip .item-l {
min-width: 110rpx;
max-width: 150rpx;
text-align: center;
}
.community-content-tip .item-l .type {
font-size: 24rpx;
background-color: #4facfe;
color: #fff;
border-radius: 3px;
padding: 3rpx 5rpx;
}
.community-content-tip .item-l .type.green {
background-color: green;
}
.community-content-tip .item-r {
flex: 1;
margin-left: 5px;
}
.community-content-tip .item-ft {
width: 20rpx;
}
.community-content-tip .item-ft .img {
width: 20rpx;
}
.community-content-tip .item {
display: flex;
align-items: center;
}
.community-content-tip .img {
width: 80rpx;
height: 80rpx;
border-radius: 50%;
}
.community-content-tip .name {
font-weight: bold;
color: #333;
}
.community-content-tip .address {
color: #999;
font-size: 28rpx;
}
.community-box .closeBtn {
width: 80rpx;
height: 80rpx;
margin: 0 auto;
}
.distance {
font-size: 24rpx;
color: #f75451;
font-weight: normal;
}

View File

@ -0,0 +1,106 @@
function e(e, t, a) {
return t in e ? Object.defineProperty(e, t, {
value: a,
enumerable: !0,
configurable: !0,
writable: !0
}) : e[t] = a, e;
}
var t = [],
a = 0,
r = [];
var app = getApp();
Component({
properties: {
imgMax: {
type: Number,
value: 0
},
token: String,
key: {
type: String,
value: "wx-upload"
}
},
data: {
imgGroup: [],
progressList: []
},
methods: {
addImg: function() {
var s = this,
i = this.data.imgGroup;
wx.chooseMedia({
count: this.data.imgMax - i.length,
success: function(n) {
const tempFiles = n.tempFiles;
s.triggerEvent("on-chooseImage", {key: s.data.key}), (i = i.concat(tempFiles)).length > s.data.imgMax && i.splice(s.data.imgMax),
s.setData({
imgGroup: i
});
var o = tempFiles.length;
a = i.length;
for (var g = 0; g < o; g++) ! function(i) {
var g = tempFiles[i].tempFilePath.split(".")[tempFiles[i].tempFilePath.split(".").length - 1],
l = new Date().getTime(),
p = Math.round(1e6 * Math.random());
r[i + a - o] = wx.uploadFile({
url: app.util.url('entry/wxapp/index', {
'm': 'eaterplanet_ecommerce',
'controller': 'goods.doPageUpload'
}),
filePath: tempFiles[i].tempFilePath,
name: "upfile",
header: {
"Content-Type": "multipart/form-data"
},
formData: {
token: s.data.token,
key: s.data.key + "-" + l + "-" + p + "." + g
},
success: function(r) {
t[i + a - o] = JSON.parse(r.data).image_o, s.setData(e({}, "progressList[" + (i + a - o) + "]", 100)),
s.triggerEvent("on-changeImage", {
value: t,
len: a,
key: s.data.key
});
}
}), r[i + a - o].onProgressUpdate(function(t) {
var r = t.progress;
s.setData(e({}, "progressList[" + (i + a - o) + "]", r));
});
}(g);
}
});
},
remove: function(e) {
var s = e.currentTarget.dataset.idx,
i = this.data.imgGroup,
n = this.data.progressList;
n[s] < 100 && r[s].abort(), i.splice(s, 1), r.splice(s, 1), n.splice(s, 1), t.splice(s, 1),
a = i.length, this.setData({
imgGroup: i,
progressList: n
}), this.triggerEvent("on-changeImage", {
value: t,
len: a,
key: this.data.key
});
},
bigImg: function(e) {
var t = e.currentTarget.dataset.src,
a = e.currentTarget.dataset.list;
wx.previewImage({
current: t,
urls: a
});
}
},
detached: function() {
console.log("detached"), t = [], a = 0, r = [];
}
});

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,15 @@
<view class="img-group">
<view class="img-item" wx:if="{{imgGroup.length}}" wx:for="{{imgGroup}}" wx:key="id">
<view bindtap="remove" class="close" data-idx="{{index}}">
<image class='closeImg' src="../../images/img-close.png"></image>
</view>
<image class="img" bindtap="bigImg" data-list="{{imgGroup}}" data-src="{{item}}" mode="aspectFill" src="{{item}}"></image>
<view class="progress {{progressList[index]===100?'hide-progress':''}}">
<text class="span" style="width: {{progressList[index]+'%'}}"></text>
</view>
</view>
<view bindtap="addImg" class="img-item img-add" wx:if="{{imgGroup.length<imgMax}}">
<image class="cameraImg" src="../../images/icon-camera.png"></image>
<text>{{imgGroup.length?imgGroup.length+'/'+imgMax:'上传图片'}}</text>
</view>
</view>

View File

@ -0,0 +1,81 @@
.img-group {
display: flex;
flex-wrap: wrap;
font-size: 24rpx;
margin-top: 30rpx;
}
.img-group .img-item {
margin: 0 6rpx;
width: 150rpx;
height: 150rpx;
position: relative;
box-sizing: border-box;
}
.img-group .img-item .img {
width: 150rpx;
height: 150rpx;
}
.img-group .img-item .progress {
position: absolute;
left: 16rpx;
bottom: 20rpx;
width: 120rpx;
height: 16rpx;
border-radius: 20rpx;
border: 2rpx solid #ddd;
display: flex;
align-items: center;
}
.img-group .img-item .progress .span {
height: 8rpx;
width: 0;
max-width: 112rpx;
border-radius: 12rpx;
position: absolute;
left: 4rpx;
top: 4rpx;
background: #f5f5f5;
}
.img-group .img-item .hide-progress {
opacity: 0;
}
.img-group .img-item .close {
width: 32rpx;
height: 32rpx;
position: absolute;
right: -8rpx;
top: -8rpx;
z-index: 1;
}
.img-group .img-item .closeImg {
height: 100%;
width: 100%;
font-size: 40rpx;
color: #a0a0a0;
}
.img-group .img-add {
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
border: 2rpx dashed #dedede;
color: #bcbcbc;
}
.img-group .img-add .cameraImg {
width: 44rpx;
height: 44rpx;
color: #cdcdcd;
margin-bottom: 8rpx;
display: flex;
justify-content: center;
align-items: center;
}

View File

@ -0,0 +1,43 @@
var e = require("../../utils/timeFormat");
Component({
properties: {
spuItem: {
type: Object,
value: {
spuImage: "",
spuName: "",
endTime: "",
beginTime: "",
actPrice: [],
marketPrice: [],
desc: "新鲜自然 唇齿留香",
surplusNum: 0,
soldNum: 0,
limitOrderNum: 0,
limitMemberNum: 0,
serverTime: 0,
skuImage: ""
},
observer: function (m) {
if (m) {
var i = (0, e.formatTime)(new Date(1 * m.endTime)), r = (0, e.getBeginTime)(m.beginTime, m.serverTime), t = (0,
e.formatNumber)(i.month) + "月" + (0, e.formatNumber)(i.day) + "日 " + (0, e.formatNumber)(i.hour) + ":" + (0,
e.formatNumber)(i.minute);
this.setData({
formatBeginTime: r,
endTime: t
});
}
}
},
isPast: {
type: Boolean,
value: false
}
},
data: {
formatBeginTime: "",
endTime: ""
}
});

View File

@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"i-img": "../img/index",
"i-router-link": "../router-link/router-link"
}
}

View File

@ -0,0 +1,20 @@
<navigator class="comming-spu-content" url="/eaterplanet_ecommerce/pages/goods/goodsDetail?id={{spuItem.actId}}">
<i-img class="spu-img-content" defaultImage="../../images/index-comming-goods-bitmap.png" height="120" iClass="spu-img" loadImage="{{spuItem.skuImage}}" width="120"></i-img>
<view class="spu-name">
<text class='span'>{{spuItem.spuName}}</text>
</view>
<view class="spu-desc" wx:if="{{isPast}}">结束时间 {{endTime}}</view>
<view class="spu-desc" wx:else>{{formatBeginTime}}{{spuItem.limitOrderNum>-1||spuItem.limitMemberNum>-1?' | 限购':''}}</view>
<view class="spu-price">
<view class="sale-price">
<text class='span'>¥{{spuItem.actPrice[0]}}</text>.{{spuItem.actPrice[1]}}
</view>
<view class="market-price">¥{{spuItem.marketPrice[0]}}.{{spuItem.marketPrice[1]}}</view>
</view>
<view class="mask" wx:if="{{isPast}}">
<view class="toast">已结束</view>
</view>
<view class="icon-shop" wx:if="{{isPast}}">
<image class='img' src="../../images/icon-add-shopCart-disabled.png"></image>
</view>
</navigator>

View File

@ -0,0 +1,113 @@
.icon-shop {
position: absolute;
right: 20rpx;
bottom: 20rpx;
width: 54rpx;
height: 54rpx;
}
.icon-shop .img {
width: 54rpx;
height: 54rpx;
}
.mask {
width: 348rpx;
height: 240rpx;
position: absolute;
left: 0;
top: 30rpx;
background: rgba(255, 255, 255, 0.5);
display: flex;
align-items: center;
justify-content: center;
}
.mask .toast {
width: 196rpx;
height: 60rpx;
background: rgba(0, 0, 0, 0.5);
border-radius: 10rpx;
text-align: center;
line-height: 60rpx;
color: #fff;
font-weight: bold;
font-size: 28rpx;
}
.spu-img {
width: 240rpx;
height: 240rpx;
border-radius: 10rpx;
}
.comming-spu-content {
width: 348rpx;
height: 452rpx;
border-radius: 20rpx;
background: #fff;
box-sizing: border-box;
padding: 30rpx 26rpx 30rpx 26rpx;
box-shadow: 0 0 40rpx rgba(0, 0, 0, 0.05);
position: relative;
}
.comming-spu-content .spu-img-content {
display: flex;
align-items: center;
justify-content: center;
width: 296rpx;
height: 240rpx;
margin: 0 auto 34rpx;
}
.comming-spu-content .spu-name {
font-size: 28rpx;
line-height: 28rpx;
height: 36rpx;
color: #444;
margin-bottom: 16rpx;
font-weight: 500;
position: relative;
}
.comming-spu-content .spu-name .span {
width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
position: absolute;
left: 0;
top: -4rpx;
line-height: 36rpx;
}
.comming-spu-content .spu-desc {
color: #ffab20;
font-size: 24rpx;
line-height: 24rpx;
margin-bottom: 14rpx;
}
.comming-spu-content .spu-price {
display: flex;
align-items: flex-end;
font-size: 20rpx;
}
.comming-spu-content .spu-price .sale-price {
color: #ff758c;
margin-right: 8rpx;
}
.comming-spu-content .spu-price .sale-price .span {
font-size: 40rpx;
line-height: 40rpx;
margin-left: 4rpx;
font-weight: 500;
}
.comming-spu-content .spu-price .market-price {
text-decoration: line-through;
color: #999;
}

View File

@ -0,0 +1,66 @@
var utils = require("../../utils/index");
var location = require("../../utils/Location");
var app = getApp();
Component({
/**
* 组件的属性列表
*/
properties: {
item: {
type: Object,
value: {
rest: 0
}
},
city: Object,
isOld: {
type: Boolean,
value: false
},
groupInfo: {
type: Object,
value: {
group_name: '社区',
owner_name: '团长'
}
},
hiddenDetails: {
type: Number,
value: 0
},
skin: {
type: Object
}
},
/**
* 组件的方法列表
*/
methods: {
chooseCommunity: function (event) {
var community = event.currentTarget.dataset.val;
if ("火星社区" !== community.communityName || community.communityId) {
var disUserHeadImg = community.disUserHeadImg || community.headImg || "",
disUserName = community.disUserName || community.realName || "",
data = {
communityId: community.communityId,
communityName: community.communityName,
disUserName: disUserName,
disUserHeadImg: disUserHeadImg,
communityAddress: community.communityAddress,
distance: community.distance,
fullAddress: community.fullAddress || community.communityAddress,
lat: community.lat,
lon: community.lon
},
city = this.data.city;
(0, utils.changeCommunity)(data, city);
} else {
location.openSetting(app).then(function () {
location.checkGPS(app, function () { });
});
}
}
}
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,18 @@
<view bindtap="chooseCommunity" class="community-item i-class" data-val="{{item}}">
<view class="group-img">
<image class="group-head" src="{{item.headImg||item.disUserHeadImg}}" wx:if="{{item.headImg||item.disUserHeadImg}}"></image>
<image class="group-head" src="../../images/head-bitmap.png" wx:else></image>
<text class="rest" wx:if="{{item.rest==1}}">休息中</text>
</view>
<view class="item-center">
<view class="community-title">
<text class='span'>{{item.communityName}}</text>
<text class='em' wx:if="{{!isOld&&item.distance}}" style="color:{{skin.color}}">距离{{item.distance}}</text>
</view>
<view class="group-master">
{{groupInfo.owner_name}}{{item.realName||item.disUserName}}
<image class="right-arrow" src="../../images/community-right-arrow.png"></image>
</view>
<view class="community-address" wx:if="{{hiddenDetails==0}}">{{item.fullAddress||item.communityAddress}}</view>
</view>
</view>

View File

@ -0,0 +1,88 @@
.community-item {
box-sizing: border-box;
display: flex;
padding: 60rpx 30rpx;
margin: 20rpx 0rpx 20rpx 0rpx;
border-radius: 20rpx;
}
.community-item .group-head {
width: 80rpx;
height: 80rpx;
border-radius: 80rpx;
margin-right: 20rpx;
}
.community-item .community-title {
font-size: 32rpx;
line-height: 32rpx;
height: 32rpx;
width: 520rpx;
margin-bottom: 20rpx;
display: flex;
justify-content: space-between;
align-items: flex-end;
}
.community-item .community-title .span {
color: #444;
font-weight: 500;
}
.community-item .community-title .em {
color: #4facfe;
font-size: 26rpx;
line-height: 26rpx;
white-space: nowrap;
}
.community-item .community-address {
font-size: 26rpx;
line-height: 34rpx;
color: #666;
width: 520rpx;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
text-overflow: initial;
white-space: normal;
}
.community-item .group-master {
width: 560rpx;
font-size: 26rpx;
line-height: 26rpx;
color: #aaa;
position: relative;
margin-bottom: 6rpx;
}
.community-item .group-master .right-arrow {
position: absolute;
right: 0;
top: 0;
width: 14rpx;
height: 28rpx;
}
.group-img {
position: relative;
width: 80rpx;
height: 80rpx;
border-radius: 80rpx;
margin-right: 20rpx;
overflow: hidden;
}
.rest {
position: absolute;
left: 0;
bottom: 8rpx;
right: 0;
font-size: 18rpx;
background: rgba(255, 83, 68, 0.8);
text-align: center;
color: #fff;
padding: 2rpx 0 3rpx;
}

View File

@ -0,0 +1,81 @@
var t = require("../../utils/timeFormat");
Component({
properties: {
target: {
type: String,
observer: function(t) {
this.init(t);
}
},
showDay: Boolean,
beginTime: String,
callback: String,
format: Array,
clearTimer: {
type: Boolean,
observer: function (t) {
t&&clearTimeout(this.data.timer);
}
}
},
externalClasses: ["countdown-class", "item-class"],
data: {
time: {
day: "0",
second: "00",
minute: "00",
hour: "00"
},
resultFormat: [],
changeFormat: false,
timeStamp: 0,
timer: null
},
methods: {
init: function(t) {
var e = {
day: "0",
second: "00",
minute: "00",
hour: "00"
};
if (t - new Date().getTime() <= 0) return this.setData({
time: e
}), void this.triggerEvent("callback");
this.interval(t);
},
interval: function(e) {
var a = this,
i = e - new Date().getTime();
if (i <= 0) return clearTimeout(this.data.timer), this.triggerEvent("callback"),
void this.setData({
time: {
day: "0",
second: "00",
minute: "00",
hour: "00"
}
});
var r = Math.ceil(i / 1000),
n = parseInt(r / 86400),
o = r % 86400,
s = (0, t.formatNumber)(parseInt(o / 3600));
o %= 3600;
var m = {
day: n,
hour: s,
minute: (0, t.formatNumber)(parseInt(o / 60)),
second: (0, t.formatNumber)(o % 60)
};
this.setData({
time: m
}), this.data.timer = setTimeout(function() {
a.interval(e);
}, 1000);
}
},
detached: function() {
clearTimeout(this.data.timer);
}
});

View File

@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"routerLink": "../router-link/router-link"
}
}

View File

@ -0,0 +1,7 @@
<view class="countdown-class i-count-down">
<slot></slot>
<em class="em" wx:if="{{showDay&&time.day>0}}">{{time.day}}天</em>
<text class="item-class">{{time.hour}}</text>:
<text class="item-class">{{time.minute}}</text>:
<text class="item-class">{{time.second}}</text>
</view>

View File

@ -0,0 +1,12 @@
.i-count-down {
white-space: nowrap;
}
.em {
margin-right: 12rpx;
}
.item-class {
display: inline-block;
margin: 0 4rpx;
}

View File

@ -0,0 +1,277 @@
// components/datatimepicker/datatimepicker.js
Component({
behaviors: ['wx://form-field'],
externalClasses: ["i-class"],
properties: {
format: {
type: String
},
name: {
type: String
},
placeholder: {
type: String
}
},
data: {},
lifetimes: {
attached: function() {
//当前时间 年月日 时分秒
const date = new Date()
const curYear = date.getFullYear()
const curMonth = date.getMonth() + 1
const curDay = date.getDate()
const curHour = date.getHours()
const curMinute = date.getMinutes()
const curSecond = date.getSeconds()
//初始化时间选择轴
this.setData({
chooseYear: curYear
})
this.initColumn(curMonth);
if(curMonth==2) this.setData({ days: this.data.multiArray[2] })
//不足两位的前面好补0 因为后面要获取在时间轴上的索引 时间轴初始化的时候都是两位
var showMonth = curMonth < 10 ? ('0' + curMonth) : curMonth
var showDay = curDay < 10 ? ('0' + curDay) : curDay
var showHour = curHour < 10 ? ('0' + curHour) : curHour
var showMinute = curMinute < 10 ? ('0' + curMinute) : curMinute
var showSecond = curSecond < 10 ? ('0' + curSecond) : curSecond
//当前时间在picker列上面的索引 为了当打开时间选择轴时选中当前的时间
var indexYear = this.data.years.indexOf(curYear + '')
var indexMonth = this.data.months.indexOf(showMonth + '')
var indexDay = this.data.days.indexOf(showDay + '')
var indexHour = this.data.hours.indexOf(showHour + '')
var indexMinute = this.data.minutes.indexOf(showMinute + '')
var indexSecond = this.data.seconds.indexOf(showSecond + '')
var multiIndex = []
var multiArray = []
var value = ''
var format = this.properties.format;
if (format == 'yyyy-MM-dd') {
multiIndex = [indexYear, indexMonth, indexDay]
value = `${curYear}-${showMonth}-${showDay}`
multiArray = [this.data.years, this.data.months, this.data.days]
}
if (format == 'HH:mm:ss') {
multiIndex = [indexHour, indexMinute, indexSecond]
value = `${showHour}:${showMinute}:${showSecond}`
multiArray = [this.data.hours, this.data.minutes, this.data.seconds]
}
if (format == 'yyyy-MM-dd HH:mm') {
multiIndex = [indexYear, indexMonth, indexDay, indexHour, indexMinute]
value = `${curYear}-${showMonth}-${showDay} ${showHour}:${showMinute}`
multiArray = [this.data.years, this.data.months, this.data.days, this.data.hours, this.data.minutes]
}
if (format == 'yyyy-MM-dd HH:mm:ss') {
multiIndex = [indexYear, indexMonth, indexDay, indexHour, indexMinute, indexSecond]
value = `${curYear}-${showMonth}-${showDay} ${showHour}:${showMinute}:${showSecond}`
multiArray = [this.data.years, this.data.months, this.data.days, this.data.hours, this.data.minutes, this.data.seconds]
}
this.setData({
// value, // 初始时间
multiIndex,
multiArray,
curMonth,
chooseYear: curYear,
})
}
},
/**
* 组件的方法列表
*/
methods: {
//获取时间日期
bindPickerChange: function(e) {
this.setData({
multiIndex: e.detail.value
})
const index = this.data.multiIndex
var format = this.properties.format
var showTime = ''
if (format == 'yyyy-MM-dd') {
const year = this.data.multiArray[0][index[0]]
const month = this.data.multiArray[1][index[1]]
const day = this.data.multiArray[2][index[2]]
showTime = `${year}-${month}-${day}`
}
if (format == 'HH:mm:ss') {
const hour = this.data.multiArray[0][index[0]]
const minute = this.data.multiArray[1][index[1]]
const second = this.data.multiArray[2][index[2]]
showTime = `${hour}:${minute}:${second}`
}
if (format == 'yyyy-MM-dd HH:mm') {
const year = this.data.multiArray[0][index[0]]
const month = this.data.multiArray[1][index[1]]
const day = this.data.multiArray[2][index[2]]
const hour = this.data.multiArray[3][index[3]]
const minute = this.data.multiArray[4][index[4]]
showTime = `${year}-${month}-${day} ${hour}:${minute}`
}
if (format == 'yyyy-MM-dd HH:mm:ss') {
const year = this.data.multiArray[0][index[0]]
const month = this.data.multiArray[1][index[1]]
const day = this.data.multiArray[2][index[2]]
const hour = this.data.multiArray[3][index[3]]
const minute = this.data.multiArray[4][index[4]]
const second = this.data.multiArray[5][index[5]]
showTime = `${year}-${month}-${day} ${hour}:${minute}:${second}`
}
this.setData({
value: showTime
})
this.triggerEvent('dateTimePicker', showTime)
},
//初始化时间选择轴
initColumn(curMonth) {
const years = []
const months = []
const days = []
const hours = []
const minutes = []
const seconds = []
for (let i = 2019; i <= 2099; i++) {
years.push(i + '')
}
for (let i = 1; i <= 12; i++) {
if (i < 10) {
i = "0" + i;
}
months.push(i + '')
}
if (curMonth == 1 || curMonth == 3 || curMonth == 5 || curMonth == 7 || curMonth == 8 || curMonth == 10 || curMonth == 12) {
for (let i = 1; i <= 31; i++) {
if (i < 10) {
i = "0" + i;
}
days.push(i + '')
}
}
if (curMonth == 4 || curMonth == 6 || curMonth == 9 || curMonth == 11) {
for (let i = 1; i <= 30; i++) {
if (i < 10) {
i = "0" + i;
}
days.push(i + '')
}
}
if (curMonth == 2) {
this.setFebDays()
}
for (let i = 0; i <= 23; i++) {
if (i < 10) {
i = "0" + i;
}
hours.push(i + '')
}
for (let i = 0; i <= 59; i++) {
if (i < 10) {
i = "0" + i;
}
minutes.push(i + '')
}
for (let i = 0; i <= 59; i++) {
if (i < 10) {
i = "0" + i;
}
seconds.push(i + '')
}
this.setData({
years,
months,
days,
hours,
minutes,
seconds
})
},
/**
* 列改变时触发
*/
bindPickerColumnChange: function(e) {
//获取年份 用于计算改年的2月份为平年还是闰年
if (e.detail.column == 0 && this.properties.format != 'HH:mm:ss') {
var chooseYear = this.data.multiArray[e.detail.column][e.detail.value];
this.setData({
chooseYear
})
if (this.data.curMonth == '02' || this.data.chooseMonth == '02') {
this.setFebDays()
}
}
//当前第二为月份时需要初始化当月的天数
if (e.detail.column == 1 && this.properties.format != 'HH:mm:ss') {
let num = parseInt(this.data.multiArray[e.detail.column][e.detail.value]);
let temp = [];
if (num == 1 || num == 3 || num == 5 || num == 7 || num == 8 || num == 10 || num == 12) { //31天的月份
for (let i = 1; i <= 31; i++) {
if (i < 10) {
i = "0" + i;
}
temp.push("" + i);
}
this.setData({
['multiArray[2]']: temp
});
} else if (num == 4 || num == 6 || num == 9 || num == 11) { //30天的月份
for (let i = 1; i <= 30; i++) {
if (i < 10) {
i = "0" + i;
}
temp.push("" + i);
}
this.setData({
['multiArray[2]']: temp
});
} else if (num == 2) { //2月份天数
this.setFebDays()
}
}
var data = {
multiArray: this.data.multiArray,
multiIndex: this.data.multiIndex
};
data.multiIndex[e.detail.column] = e.detail.value;
this.setData(data);
},
//计算二月份天数
setFebDays() {
let year = parseInt(this.data.chooseYear);
let temp = [];
if (year % (year % 100 ? 4 : 400) ? false : true) {
for (let i = 1; i <= 29; i++) {
if (i < 10) {
i = "0" + i;
}
temp.push("" + i);
}
this.setData({
['multiArray[2]']: temp,
chooseMonth: '02'
});
} else {
for (let i = 1; i <= 28; i++) {
if (i < 10) {
i = "0" + i;
}
temp.push("" + i);
}
this.setData({
['multiArray[2]']: temp,
chooseMonth: '02'
});
}
}
},
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,5 @@
<view class="item-value i-class">
<picker mode="multiSelector" bindchange="bindPickerChange" bindcolumnchange="bindPickerColumnChange" value="{{multiIndex}}" range="{{multiArray}}">
<input disabled="{{true}}" value='{{value}}' name='{{name}}' placeholder="{{placeholder}}" />
</picker>
</view>

View File

@ -0,0 +1,5 @@
.item-value {
text-align: right;
font-size: 26rpx;
position: relative;
}

View File

@ -0,0 +1,29 @@
Component({
externalClasses: ["i-class", "i-btn"],
properties: {
visible: {
type: Boolean,
value: false
},
text: String,
confirmText: {
type: String,
value: "确定"
},
showCancel: {
type: Boolean,
value: true
}
},
methods: {
confirm: function () {
this.triggerEvent("confirm");
},
cancel: function () {
this.triggerEvent("cancel");
},
close: function () {
this.triggerEvent("cancel");
}
}
});

View File

@ -0,0 +1,7 @@
{
"component": true,
"usingComponents": {
"i-modal": "../modal/index",
"i-button": "../button/index"
}
}

View File

@ -0,0 +1,22 @@
<i-modal bindtap="close" class="dialog" scrollUp="{{false}}" visible="{{visible}}">
<view class="dialog-content">
<view class="text i-class" wx:if="{{text}}">{{text}}</view>
<view wx:el>
<slot></slot>
</view>
<view class="button-group">
<block wx:if="{{showCancel}}">
<i-button catchtap="cancel" iClass="left-btn">
<view>取消</view>
</i-button>
<view class="split-line"></view>
<i-button catchtap="confirm" iClass="right-btn">
<view>{{confirmText}}</view>
</i-button>
</block>
<block wx:else>
<view catchtap="confirm" class="r-btn i-btn">{{confirmText}}</view>
</block>
</view>
</view>
</i-modal>

View File

@ -0,0 +1,46 @@
.dialog-content {
width: 540rpx;
height: 208rpx;
border-radius: 30rpx;
background: #fff;
}
.dialog-content .text {
height: 120rpx;
display: flex;
justify-content: center;
align-items: center;
border-bottom: 2rpx solid #d2d2d2;
}
.dialog-content .button-group {
display: flex;
}
.dialog-content .left-btn, .dialog-content .right-btn {
width: 270rpx;
height: 88rpx;
text-align: center;
line-height: 88rpx;
font-size: 36rpx;
color: #0076ff;
margin: 0;
padding: 0;
}
.dialog-content .split-line {
width: 0;
height: 88rpx;
border-right: 2rpx solid #d2d2d2;
}
.dialog-content .r-btn {
width: 540rpx;
height: 88rpx;
text-align: center;
line-height: 88rpx;
font-size: 36rpx;
color: #0076ff;
margin: 0;
padding: 0;
}

View File

@ -0,0 +1,64 @@
var app = getApp();
Component({
properties: {
value: {
type: Object,
value: {}
},
idx: {
type: Number,
value: 0
}
},
data: {
// list: [],
_lock: false
},
attached: function() {
this.setData({_lock: true },()=>{
this.getGoodsList();
})
},
pageLifetimes: {
show: function () {
this.data._lock || this.getGoodsList();
}
},
methods: {
getGoodsList() {
var token = wx.getStorageSync('token');
var that = this;
var cur_community = wx.getStorageSync('community');
let value = this.data.value;
let sources = value.sources;
let params = {};
if(sources=='category') {
params.gid = value.categoryId;
params.is_random = 0;
} else {
params.is_random = 1;
}
app.util.request({
url: 'entry/wxapp/index',
data: {
controller: 'index.load_gps_goodslist',
token,
pageNum: 1,
head_id: cur_community.communityId || '',
per_page: value.goodsCount,
...params
},
dataType: 'json',
success: function (res) {
that.setData({ _lock: false })
that.triggerEvent('diyGoodsList', { id: that.data.idx, data: res.data });
}
})
}
}
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,3 @@
<view class="goods-list" style="{{'background-color:'+(value.backgroundColor)+';'+('margin-top:'+(value.marginTop*2+'rpx')+';')}}">
<slot></slot>
</view>

View File

@ -0,0 +1,75 @@
var app = getApp();
Component({
properties: {
value: {
type: Object,
value: {}
},
idx: {
type: Number,
value: 0
}
},
data: {
// list: [],
_lock: false,
current: 0
},
attached: function() {
this.setData({_lock: true },()=>{
this.getGoodsList();
})
},
pageLifetimes: {
show: function () {
this.data._lock || this.getGoodsList();
}
},
methods: {
getGoodsList() {
var token = wx.getStorageSync('token');
var that = this;
var cur_community = wx.getStorageSync('community');
let { current, value } = this.data;
let vlist = value.list;
let sources = vlist[current].sources;
let params = {};
if(sources=='category') {
params.gid = vlist[current].categoryId;
params.is_random = 0;
} else {
params.is_random = 1;
}
app.util.request({
url: 'entry/wxapp/index',
data: {
controller: 'index.load_gps_goodslist',
token,
pageNum: 1,
head_id: cur_community.communityId || '',
per_page: 20 || value.goodsCount,
...params
},
dataType: 'json',
success: function (res) {
console.log('many_goods_list')
that.setData({ _lock: false })
that.triggerEvent('diyGoodsList', { id: that.data.idx, data: res.data });
}
})
},
changeCate(e) {
let idx = e.currentTarget.dataset.idx;
this.setData({
current: idx
},()=>{
this.getGoodsList();
})
}
}
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,14 @@
<view class="goods-list" style="{{'background-color:'+(value.backgroundColor)+';'+('margin-top:'+(value.marginTop*2+'rpx')+';')}}">
<scroll-view scrollWithAnimation scroll-x="true" scroll-y="false" class="tabs__navs">
<view class="navlist">
<block wx:for="{{value.list}}" wx:key="index">
<view class="split-line" wx:if="{{index!=0}}"></view>
<view class="item {{index==current?'active':''}}" data-idx="{{index}}" bindtap="changeCate">
<view class="name">{{item.title}}</view>
<view class="tag">{{item.desc}}</view>
</view>
</block>
</view>
</scroll-view>
<slot></slot>
</view>

View File

@ -0,0 +1,47 @@
.navlist {
position: relative;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
align-items: center;
margin-left: 20rpx;
margin-right: 20rpx;
margin-bottom: 20rpx;
}
.navlist .item {
width: 120rpx;
flex-shrink: 0;
text-align: center;
}
.navlist .item .name {
font-size: 32rpx;
color: #303133;
line-height: 1;
}
.navlist .item .tag {
font-size: 24rpx;
color: #909399;
margin-top: 10rpx;
line-height: 36rpx;
}
.navlist .item.active .name {
font-weight: bold;
}
.navlist .item.active .tag {
background: rgb(255, 69, 68);
color: #FFFFFF;
border-radius: 20rpx;
}
.split-line {
width: 1rpx;
height: 30rpx;
background-color: #E5E5E5;
margin-right: calc((100% - 121rpx * 4) / 6);
margin-left: calc((100% - 121rpx * 4) / 6);
}

View File

@ -0,0 +1,133 @@
var util = require('../../utils/util.js');
var app = getApp();
Component({
/**
* 组件的属性列表
*/
properties: {
list: {
type: Object,
value: {},
observer: function (t) {
if(t.selectedTemplate=="imageNavigation") {
let num = t.showType*2;
let len = t.list.length;
let number = Math.ceil(len/num);
let isSwiper = false;
if(number>1) {
isSwiper = true;
}
let newlist = this.chunk(t.list, num);
this.setData({ isSwiper, number, newlist })
}
}
},
skin: {
type: Object
},
},
/**
* 组件的初始数据
*/
data: {
isSwiper: false,
number: 0,
newlist: [],
current: 0,
swiperHeight: 0
},
attached() {
this.getCurH()
},
/**
* 组件的方法列表
*/
methods: {
chunk: function(array, size) {
var result = [];
for (var x = 0; x < Math.ceil(array.length / size); x++) {
var start = x * size;
var end = start + size;
result.push(array.slice(start, end));
}
return result;
},
getCurH() {
let current = this.data.current;
let that = this;
const query = wx.createSelectorQuery().in(this);
query.select('#nav_'+current).boundingClientRect(function (rect) {
rect&&that.setData({ swiperHeight: rect.height })
}).exec();
},
goDiysliderUrl: function(t) {
let link = t.currentTarget.dataset.link;
let needAuth = this.data.needAuth;
if (Object.keys(link).length > 0) {
let type = link.parents;
if (util.checkRedirectTo(link.wap_url, needAuth)) {
this.authModal();
return;
}
switch(type) {
case "WEBVIEW":
let url = link.wap_url;
url && wx.navigateTo({ url: '/eaterplanet_ecommerce/pages/web-view?url=' + encodeURIComponent(url) });
break;
case "MALL_LINK":
url = link.wap_url;
if (url.indexOf('eaterplanet_ecommerce/pages/index/index') != -1 || url.indexOf('eaterplanet_ecommerce/pages/order/shopCart') != -1 || url.indexOf('eaterplanet_ecommerce/pages/user/me') != -1 || url.indexOf('eaterplanet_ecommerce/pages/type/index') != -1) {
url && wx.switchTab({ url })
} else {
url && wx.navigateTo({ url })
}
break;
case "OTHER_APPLET":
// 跳转小程序
let appId = link.appid;
let path = link.wap_url;
appId && wx.navigateToMiniProgram({
appId,
path,
extraData: {},
envVersion: 'release',
success(res) {},
fail(error) { wx.showModal({ title: "提示", content: error.errMsg, showCancel: false }) }
})
break;
case "CUSTOM_LINK":
url = link.wap_url;
if (url.indexOf('eaterplanet_ecommerce/pages/index/index') != -1 || url.indexOf('eaterplanet_ecommerce/pages/order/shopCart') != -1 || url.indexOf('eaterplanet_ecommerce/pages/user/me') != -1 || url.indexOf('eaterplanet_ecommerce/pages/type/index') != -1) {
url && wx.switchTab({ url })
} else {
url && wx.navigateTo({ url })
}
break;
case "GOODS_CATEGORY":
//独立分类
let cateId = link.id;
app.globalData.typeCateId = cateId;
wx.switchTab({
url: '/eaterplanet_ecommerce/pages/type/index'
})
break;
default:
url = link.wap_url;
url && wx.navigateTo({ url })
break;
}
}
},
onCurrent(e) {
this.setData({
current: e.detail.current
}, ()=>{
this.getCurH()
})
}
}
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,31 @@
<view style="margin: {{list.marginTop*2}}rpx 20rpx 0;color: {{list.textColor}};border-radius:10rpx;overflow: hidden;">
<block wx:if="{{isSwiper}}">
<swiper bindchange="onCurrent" style="height:{{swiperHeight}}px;">
<swiper-item class="navigation-text" wx:for='{{number}}' wx:key="index">
<view id="nav_{{index}}" class="ep-icon-group col-{{list.showType?list.showType:4}} {{list.navRadius}}" style="{{list.backgroundColor?'background:'+list.backgroundColor+';':''}}">
<block wx:for='{{newlist[index]}}' wx:for-item='navItem' wx:for-index='idx' wx:key="nav">
<view url="{{navItem.linkurl}}" class="ep-icon-col" bindtap="goDiysliderUrl" data-link="{{navItem.link}}">
<view wx:if="{{list.selectedTemplate=='imageNavigation'}}">
<image class="nav-img" src='{{navItem.imageUrl}}'></image>
</view>
<view class="nav-name text-overflow1 u-font-26">{{navItem.title}}</view>
</view>
</block>
</view>
</swiper-item>
</swiper>
<view class="navigation-indicator">
<view wx:for='{{number}}' wx:key="index" class="item" style="background: {{current==index?skin.color:''}};"></view>
</view>
</block>
<view wx:else class="ep-icon-group col-{{list.showType?list.showType:4}} {{list.navRadius}}" style="{{list.backgroundColor?'background:'+list.backgroundColor+';':''}}">
<block wx:for='{{list.list}}' wx:for-item='navItem' wx:for-index='idx' wx:key="nav">
<view url="{{navItem.linkurl}}" class="ep-icon-col" bindtap="goDiysliderUrl" data-link="{{navItem.link}}">
<view wx:if="{{list.selectedTemplate=='imageNavigation'}}">
<image class="nav-img" src='{{navItem.imageUrl}}'></image>
</view>
<view class="nav-name text-overflow1 u-font-26">{{navItem.title}}</view>
</view>
</block>
</view>
</view>

View File

@ -0,0 +1,48 @@
.ep-icon-group {
display: flex;
flex-wrap: wrap;
padding: 0 5px;
}
.ep-icon-col {
text-align: center;
display: inline-block;
box-sizing: border-box;
padding: 8px 5px;
}
.col-3 .ep-icon-col {
width: 33.33%;
}
.col-4 .ep-icon-col {
width: 25%;
}
.col-5 .ep-icon-col {
width: 20%;
}
.ep-icon-col .nav-img {
width: 86rpx;
height: 86rpx;
}
.ep-icon-group.fillet .nav-img {
border-radius: 50%;
}
.navigation-indicator {
text-align: center;
display: flex;
align-items: center;
justify-content: center;
margin: 10rpx 0 20rpx;
}
.navigation-indicator .item {
width: 30rpx;
height: 6rpx;
background: #cccccc;
margin: 0 5rpx;
}

View File

@ -0,0 +1,81 @@
var app = getApp();
Component({
/**
* 组件的属性列表
*/
properties: {
refresh: {
type: Boolean,
value: false,
observer: function (t) {
if (t) this.setData({ list: [] }), this.getPinList();
}
},
diyInfo: {
type: Object,
observer: function (t) {
if (t) {
let list = t.list || [];
list.forEach((item, index)=>{
if(item.imageUrl.indexOf('http')==-1) {
list[index].imageUrl = t.host + item.imageUrl;
}
})
this.setData({ style: t.style*1-1, styleList: list });
}
}
},
skin: {
type: Object
}
},
data: {
style: 0,
list: [],
styleList: [],
placeholdeImg: app.globalData.placeholdeImg
},
attached() {
this.getPinList();
},
/**
* 组件的方法列表
*/
methods: {
getPinList: function () {
let that = this;
var community = wx.getStorageSync('community');
let head_id = community.communityId || '';
var token = wx.getStorageSync('token');
app.util.request({
url: 'entry/wxapp/index',
data: {
controller: 'group.get_pintuan_list',
is_index: 1,
head_id,
token
},
dataType: 'json',
success: function (res) {
if (res.data.code == 0) {
let pinList = {};
let { list, pintuan_index_coming_img, pintuan_index_show } = res.data;
pinList.list = list || [];
pinList.img = pintuan_index_coming_img || '';
pinList.show = pintuan_index_show || 0;
that.setData({ pinList })
console.log('pinList', pinList)
}
}
})
},
goLink: function(event) {
let url = event.currentTarget.dataset.link;
url && wx.navigateTo({ url })
}
}
})

View File

@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"i-img": "../img/index"
}
}

View File

@ -0,0 +1,121 @@
<block wx:if="{{diyInfo.style==1}}">
<view class='pin-spec' style="{{('margin-top:'+(diyInfo.marginTop*2+'rpx')+';')}}" wx:if="{{pinList.list&&pinList.list.length}}">
<image class="pin-spec-img" mode="widthFix" src="{{diyInfo.list[style].imageUrl}}"
wx:if="{{diyInfo.list[diyInfo.style-1].imageUrl}}" bindtap="goLink" data-link="/eaterplanet_ecommerce/moduleA/pin/index"></image>
<scroll-view class='pin-spec-scroll' scroll-x>
<view class='pin-spec-wrap'>
<view class="pin-spec-item" wx:for="{{pinList.list}}" wx:key="actId" bindtap="goLink" data-link="/eaterplanet_ecommerce/moduleA/pin/goodsDetail?id={{item.actId}}">
<i-img defaultImage="../../images/placeholder-refund.png" height="200" width="200" iClass="pin-img"
loadImage="{{item.skuImage}}"></i-img>
<view wx:if="{{item.label_info && item.label_info.type==0}}" class='item-tag'>
<image class='item-tag-bg' mode='widthFix' src="../../images/tag.png"></image>
<view class='tag-name {{item.label_info.len==2?"two-word":""}}'>{{item.label_info.tagcontent}}</view>
</view>
<view wx:if="{{item.label_info && item.label_info.type==1}}" class='item-tag'
style='background:url({{item.label_info.tagcontent}}) no-repeat left top;background-size: 100%;'></view>
<view class="act-end" wx:if="{{item.spuCanBuyNum==0}}">已抢光</view>
<view class='title'>{{item.spuName}}</view>
<text class="pin-tag" style="border-color:{{skin.color}};color:{{skin.color}}">{{item.pin_count}}人团</text>
<view class='new-bot'>
<view class='price'>¥{{item.actPrice[0]}}.{{item.actPrice[1]}}</view>
<view class="market-price">¥{{item.marketPrice[0]}}.{{item.marketPrice[1]}}</view>
</view>
</view>
</view>
</scroll-view>
</view>
</block>
<block wx:elif="{{diyInfo.style==2}}">
<view class='pin-spec u-p-30' style="{{('margin-top:'+(diyInfo.marginTop*2+'rpx')+';')}}" wx:if="{{pinList.list&&pinList.list.length}}">
<view class="i-flex i-flex-spb" bindtap="goLink" data-link="/eaterplanet_ecommerce/moduleA/pin/index">
<image src="{{styleList[1].imageUrl}}" class="pin-s2-tit"></image>
<view class="u-font-24" style="color:#909399;">
<text>更多拼团</text>
<text class="iconfont icon-youjiantou fsz-22"></text>
</view>
</view>
<view class="pin-s2">
<view wx:for="{{pinList.list}}" wx:key="id" class="i-flex pin-s2-item" style="height: 250rpx;" bindtap="goLink" data-link="/eaterplanet_ecommerce/moduleA/pin/goodsDetail?id={{item.actId}}">
<view class="pos-r u-m-t-25">
<i-img defaultImage="../../images/placeholder-refund.png" height="200" width="200" iClass="pin-img" loadImage="{{item.skuImage}}"></i-img>
<view wx:if="{{item.label_info&&item.label_info.type==0}}" class='item-tag'>
<image class='item-tag-bg' mode='widthFix' src="../../images/tag.png"></image>
<view class='tag-name {{item.label_info.len==2?"two-word":""}}'>{{item.label_info.tagcontent}}</view>
</view>
<view wx:if="{{item.label_info && item.label_info.type==1}}" class='item-tag'
style='background:url({{item.label_info.tagcontent}}) no-repeat left top;background-size: 100%;'></view>
<view class="act-end" wx:if="{{item.spuCanBuyNum==0}}">已抢光</view>
</view>
<view class="i-flex-item u-m-l-20 u-p-b-25 u-p-t-25 pin-s2-item-r">
<view class="top">
<view class='title'>{{item.spuName}}</view>
<view class="label i-flex">
<view class="label-person tag" style="border-color:{{skin.color}};color:{{skin.color}}">
<text class="iconfont icon-pintuan fsz-22"></text>
<text class="label-name">{{item.pin_count}}人团</text>
</view>
<view class="label-num tag" style="border-color:{{skin.color}};color:{{skin.color}}">
<text class="label-name">已拼{{item.soldNum}}件</text>
</view>
</view>
</view>
<view class='bot i-flex i-i-flex-spb'>
<view class="content-price i-flex-item">
<view class='price'>¥<text class="u-font-32 u-m-r-10">{{item.actPrice[0]}}.{{item.actPrice[1]}}</text></view>
<view class="content-num">¥{{item.marketPrice[0]}}.{{item.marketPrice[1]}}</view>
</view>
<view class="pin-s2-btn">去拼团</view>
</view>
</view>
</view>
</view>
</view>
</block>
<block wx:elif="{{diyInfo.style==3}}">
<view class='pin-spec u-p-30' style="{{('margin-top:'+(diyInfo.marginTop*2+'rpx')+';')}}" wx:if="{{pinList.list&&pinList.list.length}}">
<view class="text-center">
<image src="{{styleList[2].imageUrl}}" class="pin-s3-tit"></image>
</view>
<view class="pin-s2">
<view wx:for="{{pinList.list}}" wx:key="id" class="i-flex pin-s2-item" style="height: 250rpx;" bindtap="goLink" data-link="/eaterplanet_ecommerce/moduleA/pin/goodsDetail?id={{item.actId}}">
<view class="pos-r u-m-t-25">
<i-img defaultImage="../../images/placeholder-refund.png" height="200" width="200" iClass="pin-img" loadImage="{{item.skuImage}}"></i-img>
<view wx:if="{{item.label_info&&item.label_info.type==0}}" class='item-tag'>
<image class='item-tag-bg' mode='widthFix' src="../../images/tag.png"></image>
<view class='tag-name {{item.label_info.len==2?"two-word":""}}'>{{item.label_info.tagcontent}}</view>
</view>
<view wx:if="{{item.label_info && item.label_info.type==1}}" class='item-tag'
style='background:url({{item.label_info.tagcontent}}) no-repeat left top;background-size: 100%;'></view>
<view class="act-end" wx:if="{{item.spuCanBuyNum==0}}">已抢光</view>
</view>
<view class="i-flex-item u-m-l-20 u-p-b-25 u-p-t-25 pin-s2-item-r">
<view class="top">
<view class='title'>{{item.spuName}}</view>
<view class="label i-flex">
<view class="label-person tag" style="border-color:{{skin.color}};color:{{skin.color}}">
<text class="iconfont icon-pintuan fsz-22"></text>
<text class="label-name">{{item.pin_count}}人团</text>
</view>
<view class="label-num tag" style="border-color:{{skin.color}};color:{{skin.color}}">
<text class="label-name">已拼{{item.soldNum}}件</text>
</view>
</view>
</view>
<view class='bot i-flex i-i-flex-spb'>
<view class="content-price i-flex-item">
<view class='price'>¥<text class="u-font-32 u-m-r-10">{{item.actPrice[0]}}.{{item.actPrice[1]}}</text></view>
<view class="content-num">¥{{item.marketPrice[0]}}.{{item.marketPrice[1]}}</view>
</view>
<view class="pin-s2-btn">去拼团</view>
</view>
</view>
</view>
</view>
<view class="u-font-24 border-top u-p-t-30 text-center" style="color:#909399;" bindtap="goLink" data-link="/eaterplanet_ecommerce/moduleA/pin/index">
<text>更多拼团</text>
<text class="iconfont icon-youjiantou fsz-22"></text>
</view>
</view>
</block>

View File

@ -0,0 +1,243 @@
@import "/icon.wxss";
@import "/common.wxss";
.pin-spec {
position: relative;
background: #fff;
margin: 20rpx;
border-radius: 10rpx;
overflow: hidden;
}
.pin-spec-img {
width: 100%;
vertical-align: top;
border-radius: 10rpx 10rpx 0 0;
}
.pin-spec-scroll {
max-height: 380rpx;
}
.pin-spec-wrap {
position: relative;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
}
.pin-spec-item {
position: relative;
width: 240rpx;
box-sizing: border-box;
padding: 20rpx;
font-size: 28rpx;
}
.pin-spec-item .pin-img {
width: 200rpx;
height: 200rpx;
margin-bottom: 20rpx;
}
.pin-spec-item .title {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.pin-spec-item .new-bot {
margin-top: 10rpx;
display: flex;
align-items: center;
}
.pin-spec-item .price {
color: #ff5041;
}
.pin-spec-item .act-end {
position: absolute;
height: 60rpx;
border-radius: 10rpx;
background: rgba(0, 0, 0, 0.5);
color: #fff;
font-size: 28rpx;
text-align: center;
line-height: 60rpx;
left: 50%;
top: 80rpx;
padding: 0 12rpx;
transform: translateX(-50%);
}
.pin-spec-item .market-price {
text-decoration: line-through;
color: #999;
font-size: 22rpx;
margin-left: 10rpx;
}
.pin-spec-item .pin-tag {
display: inline-block;
font-size: 22rpx;
padding: 0 6rpx;
margin-right: 10rpx;
border: 0.1rpx solid #ff5344;
vertical-align: middle;
color: #ff5344;
border-radius: 4rpx;
}
/* 标签 */
.pin-spec .item-tag {
position: absolute;
left: 20rpx;
top: 20rpx;
width: 54rpx;
height: 62rpx;
z-index: 1;
color: #fff;
text-align: center;
}
.item-tag-bg {
position: absolute;
left: 0;
top: 0;
width: 54rpx;
height: 62rpx;
z-index: 0;
}
.pin-spec .item-tag .tag-name {
position: relative;
padding-top: 6rpx;
font-size: 20rpx;
line-height: 1;
font-weight: 600;
z-index: 1;
}
.pin-spec .item-tag .tag-name.two-word {
font-size: 22rpx;
padding-top: 14rpx;
}
.pin-s2-tit {
width: 240rpx;
height: 70rpx;
line-height: 70rpx;
}
.pin-s2 .pin-img {
width: 200rpx;
height: 200rpx;
margin-bottom: 0;
}
.pin-s2 .act-end {
position: absolute;
height: 60rpx;
border-radius: 10rpx;
background: rgba(0, 0, 0, 0.5);
color: #fff;
font-size: 24rpx;
text-align: center;
line-height: 60rpx;
left: 50%;
top: 80rpx;
padding: 0 12rpx;
transform: translateX(-50%);
}
.pin-s2 .title {
height: 64rpx;
}
.pin-s2 .label {
padding: 4rpx 12rpx 6rpx;
line-height: 1;
font-size: 75%;
font-weight: 700;
color: #fff;
text-align: center;
white-space: nowrap;
}
.pin-s2 .label .tag {
height: 30rpx;
line-height: 30rpx;
border: 1rpx solid #FF4544;
border-radius: 4rpx;
margin-right: 10rpx;
}
.pin-s2 .label .tag.label-person .iconfont {
display: inline-block;
width: 30rpx;
height: 30rpx;
background-color: #FF4544;
font-size: 18rpx;
color: #FFFFFF;
text-align: center;
}
.pin-s2 .label .label-name {
font-size: 20rpx;
padding: 0 10rpx;
color: #FF4544;
}
.pin-s2 .bot {
line-height: 1;
}
.pin-s2 .bot .content-price {
display: flex;
align-items: flex-end;
font-size: 24rpx;
color: #FF4544;
margin-top: 20rpx;
height: 32rpx;
font-weight: 600;
}
.content-num {
font-weight: 500;
margin-top: 0;
font-size: 24rpx;
line-height: 24rpx;
color: #909399;
text-decoration: line-through;
}
.pin-s2-item-r {
display: flex;
flex-direction: column;
justify-content: space-between;
border-bottom: 1rpx solid #EEEEEE;
}
.pin-s2 .pin-s2-item:last-child .pin-s2-item-r {
border-bottom: 0;
}
.pin-s2-btn {
background-color: #FF4544;
width: 160rpx;
height: 50rpx;
line-height: 50rpx;
text-align: center;
border-radius: 50rpx;
font-size: 28rpx;
color: #FFFFFF;
}
.pin-s3-tit {
width: 348rpx;
height: 74rpx;
text-align: center;
line-height: 74rpx;
}

View File

@ -0,0 +1,23 @@
// eaterplanet_ecommerce/components/empty/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
/**
* 组件的方法列表
*/
methods: {
}
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,4 @@
<view class="none-rush-list">
<image class="img-block" src="../../images/icon-index-empty.png"></image>
<view class="h1"><slot></slot></view>
</view>

View File

@ -0,0 +1,21 @@
.none-rush-list {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-bottom: 140rpx;
padding-top: 140rpx;
}
.none-rush-list .img-block {
width: 240rpx;
height: 240rpx;
margin-bottom: 30rpx;
}
.none-rush-list .h1 {
font-size: 32rpx;
line-height: 32rpx;
color: #444;
margin-bottom: 20rpx;
}

View File

@ -0,0 +1,23 @@
Component({
properties: {
visible: {
type: Boolean,
value: false
},
coderList: {
type: Array
},
codeImg: {
type: String,
value: ''
}
},
data: {
selected: null
},
methods: {
close: function () {
this.triggerEvent("cancel");
}
}
});

View File

@ -0,0 +1,6 @@
{
"component": true,
"usingComponents": {
"i-modal": "../modal/index"
}
}

View File

@ -0,0 +1,15 @@
<i-modal bind:cancel="close" scrollUp="{{false}}" visible="{{visible}}">
<view class="coder-content">
<view bindtap="close" class="icon-wrap">
<image class="icon-close" src="../../images/icon-sku-close.png"></image>
</view>
<view class="t1">您的提货码为</view>
<!-- <view>
<text class="item" wx:for="{{coderList}}" wx:key="index">{{item}}</text>
</view> -->
<view class="code-img">
<image class="img" src="{{codeImg}}" mode="widthFix"></image>
</view>
<view class="t2">提货时,请出示提货二维码。</view>
</view>
</i-modal>

View File

@ -0,0 +1,65 @@
.coder-content {
position: relative;
height: 650rpx;
width: 630rpx;
background: #fff;
border-radius: 20rpx;
text-align: center;
font-family: PingFangSC-Medium;
}
.coder-content .t1 {
font-size: 36rpx;
font-weight: 500;
color: #444;
line-height: 36rpx;
margin-bottom: 60rpx;
margin-top: 60rpx;
}
.coder-content .t2 {
font-size: 24rpx;
font-weight: 400;
color: #bababa;
line-height: 24rpx;
margin-top: 40rpx;
}
.coder-content .item {
display: inline-block;
margin-left: 20rpx;
width: 68rpx;
height: 68rpx;
line-height: 68rpx;
text-align: center;
border-radius: 10rpx;
border: 2rpx solid #444;
font-size: 40rpx;
font-family: PingFangSC-Regular;
font-weight: 400;
color: #444;
}
.coder-content .item:first-of-type {
margin-left: 0;
}
.coder-content .icon-wrap {
height: 60rpx;
width: 60rpx;
position: absolute;
right: 10rpx;
top: 10rpx;
display: flex;
align-items: center;
justify-content: center;
}
.coder-content .icon-close {
height: 24rpx;
width: 24rpx;
}
.coder-content .code-img .img {
width: 60%;
}

View File

@ -0,0 +1,12 @@
var t = getApp();
Component({
data: {
isIpx: false
},
attached: function () {
t.globalData.isIpx && this.setData({
isIpx: true
});
}
});

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,3 @@
<view class="fixed-bar {{isIpx?'pb20':''}}">
<slot></slot>
</view>

View File

@ -0,0 +1,13 @@
.fixed-bar {
left: 0;
bottom: 0;
position: fixed;
background: #fff;
width: 100%;
z-index: 2;
padding-bottom: calc(env(safe-area-inset-bottom) - 30rpx);
}
.pb20 {
padding-bottom: 40rpx;
}

View File

@ -0,0 +1,118 @@
var app = getApp();
import WxValidate from '../../utils/WxValidate.js';
var u = true;
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
},
attached: function() {
this.initValidate();
},
/**
* 组件的方法列表
*/
methods: {
//资料验证函数
initValidate() {
const rules = {
form_username: {
required: true,
minlength: 1
},
form_mobile: {
required: true,
tel: true
}
}
const messages = {
form_username: {
required: '请填写真实姓名',
minlength: '请输入正确的姓名'
},
form_mobile: {
required: '请填写手机号',
tel: '请填写正确的手机号'
}
}
this.WxValidate = new WxValidate(rules, messages)
},
/**
* 输入框获得焦点
*/
iptFocus: function (t) {
let name = t.currentTarget.dataset.name;
this.setData({
currentFocus: name
})
},
/**
* 输入框失去焦点
*/
iptBlur: function () {
this.setData({
currentFocus: ''
})
},
//报错
showModal(error) {
wx.showModal({
content: error.msg,
showCancel: false,
})
},
/**
* 资料修改表单提交
*/
formSubmit(e) {
this.setData({
btnLoading: true
})
const params = e.detail.value;
//校验表单
if (!this.WxValidate.checkForm(params)) {
const error = this.WxValidate.errorList[0];
this.showModal(error);
this.setData({
btnLoading: false
})
return false;
}
let token = wx.getStorageSync('token');
params.token = token;
app.util.ProReq('user.save_formData', params).then(res=>{
wx.showModal({
content: res.msg || '提交成功,等待审核后才可查看价格和购买',
showCancel: false,
success: ()=>{
wx.setStorageSync('isparse_formdata', 0);
wx.reLaunch({
url: '/eaterplanet_ecommerce/pages/index/index',
})
}
})
}).catch(err=>{
this.setData({
btnLoading: false
})
app.util.message(err.msg || '提交失败,请重试', '', 'error');
})
}
}
})

View File

@ -0,0 +1,4 @@
{
"component": true,
"usingComponents": {}
}

View File

@ -0,0 +1,29 @@
<view class='gcs-box'>
<!-- 个人资料 -->
<view class="gcs-info card">
<form bindsubmit="formSubmit">
<view class="card-header">
<view class="title">会员申请</view>
</view>
<view class="card-body">
<view class="info-item">
<view class="item-title">真实姓名</view>
<view class="item-content">
<input name="form_username" value="" bindfocus="iptFocus" bindblur="iptBlur" data-name="formUsername" placeholder="请输入真实名称" />
</view>
</view>
<view class="bot-line {{currentFocus=='formUsername'?'focus':''}}"></view>
<view class="info-item">
<view class="item-title">手机号</view>
<view class="item-content">
<input name="form_mobile" type="number" value="" bindfocus="iptFocus" bindblur="iptBlur" data-name="formMobile" placeholder="请输入手机号" />
</view>
</view>
<view class="bot-line {{currentFocus=='formMobile'?'focus':''}}"></view>
</view>
<view class="edit-btn">
<button loading="{{btnLoading}}" form-type="submit">保存</button>
</view>
</form>
</view>
</view>

Some files were not shown because too many files have changed in this diff Show More