Compare commits
No commits in common. "789f8bb2905eec50a11a0a0e55181afabe7c617a" and "dd9a2705073d42dedbc15917a1f6889eb82864f0" have entirely different histories.
789f8bb290
...
dd9a270507
1
.gitignore
vendored
@ -1,2 +1 @@
|
||||
unpackage/
|
||||
.hbuilderx
|
||||
@ -2,212 +2,113 @@
|
||||
<view class="page">
|
||||
<view class="m-tab">
|
||||
<view class="m-navbar">
|
||||
<view
|
||||
:class="'m-navbar-item ' + (tapindex == 0 ? 'm-navbar-item-on' : '')"
|
||||
@click="freeget"
|
||||
>
|
||||
{{ __("免费领取") }}
|
||||
<view :class="'m-navbar-item ' + (tapindex==0?'m-navbar-item-on':'')" @click="freeget">
|
||||
{{__('免费领取')}}
|
||||
</view>
|
||||
<view
|
||||
v-if="false"
|
||||
:class="'m-navbar-item ' + (tapindex == 1 ? 'm-navbar-item-on' : '')"
|
||||
@click="buyget"
|
||||
>
|
||||
{{ __("购买获取") }}
|
||||
<view v-if="false" :class="'m-navbar-item ' + (tapindex==1?'m-navbar-item-on':'')" @click="buyget">
|
||||
{{__('购买获取')}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<scroll-view
|
||||
class="m-scrollBox"
|
||||
scroll-y="true"
|
||||
@scrolltolower="scrollbottom"
|
||||
>
|
||||
<block v-if="VoucherList.length > 0">
|
||||
<view
|
||||
:class="['m-coupon-item', item.if_gain ? '' : 'off']"
|
||||
v-for="(item, index) in VoucherList"
|
||||
:key="index"
|
||||
>
|
||||
<scroll-view class="m-scrollBox" scroll-y="true" @scrolltolower="scrollbottom">
|
||||
<block v-if="(VoucherList.length>0)">
|
||||
<view :class="['m-coupon-item', item.if_gain ? '' : 'off']" v-for="(item, index) in VoucherList" :key="index">
|
||||
<view class="m-coupon-info">
|
||||
<view class="m-coupon-text">
|
||||
<label v-if="item.activity_type != 3">
|
||||
{{item.activity_name}}
|
||||
<span
|
||||
style="font-size: 12rpx; margin-left: 6rpx; color: #ff9933"
|
||||
v-if="item.activity_on_is_off === 1"
|
||||
>(线下)</span
|
||||
>
|
||||
<span
|
||||
style="font-size: 18rpx; margin-left: 8rpx; color: #ff9933"
|
||||
>{{ item.store_name }}</span
|
||||
>
|
||||
<span style="font-size: 12rpx;margin-left:6rpx;color:#FF9933" v-if="item.activity_on_is_off === 1">(线下)</span>
|
||||
<span style="font-size: 18rpx;margin-left:8rpx;color:#FF9933">{{item.store_name}}</span>
|
||||
</label>
|
||||
<label v-else>
|
||||
{{item.product_name}}
|
||||
<span
|
||||
style="font-size: 12rpx; margin-left: 6rpx; color: #ff9933"
|
||||
v-if="item.activity_on_is_off === 1"
|
||||
>(线下)</span
|
||||
>
|
||||
<span
|
||||
style="font-size: 18rpx; margin-left: 8rpx; color: #ff9933"
|
||||
>{{ item.store_name }}</span
|
||||
>
|
||||
<span style="font-size: 12rpx;margin-left:6rpx;color:#FF9933" v-if="item.activity_on_is_off === 1">(线下)</span>
|
||||
<span style="font-size: 18rpx;margin-left:8rpx;color:#FF9933">{{item.store_name}}</span>
|
||||
</label>
|
||||
<text v-if="item.activity_type != 3">{{
|
||||
sprintf(
|
||||
__("满¥%s可用,消耗 %s 积分领取。%s"),
|
||||
item.activity_rule.requirement.buy.subtotal,
|
||||
item.activity_rule.requirement.points.needed,
|
||||
item.activity_remark
|
||||
)
|
||||
}}</text>
|
||||
<text v-else>{{
|
||||
sprintf(
|
||||
__("满¥%s可抵扣¥%s"),
|
||||
item.activity_rule.requirement.buy.subtotal,
|
||||
item.activity_rule.voucher_price
|
||||
)
|
||||
}}</text>
|
||||
<text>{{
|
||||
sprintf(
|
||||
__("有效日期至:%s"),
|
||||
item.activity_rule.voucher_end_date
|
||||
)
|
||||
}}</text>
|
||||
<text v-if="item.activity_type != 3">{{sprintf(__('满¥%s可用,消耗 %s 积分领取。%s'), item.activity_rule.requirement.buy.subtotal, item.activity_rule.requirement.points.needed, item.activity_remark)}}</text>
|
||||
<text v-else>{{sprintf(__('满¥%s可抵扣¥%s'), item.activity_rule.requirement.buy.subtotal,item.activity_rule.voucher_price)}}</text>
|
||||
<text>{{sprintf(__('有效日期至:%s'), item.activity_rule.voucher_end_date)}}</text>
|
||||
</view>
|
||||
<view class="m-coupon-price">
|
||||
<view class="price-content-box " v-if="item.activity_type == 3">
|
||||
<label>{{ __("¥") }}</label
|
||||
>{{ item.activity_rule.requirement.points.needed }}
|
||||
<label>{{__('¥')}}</label>{{item.activity_rule.requirement.points.needed}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="m-coupon-btn"
|
||||
@click="doReceive"
|
||||
:data-isreceive="item.if_gain ? '1' : '-1'"
|
||||
:data-id="item.activity_id"
|
||||
:data-point="item.activity_rule.requirement.points.needed"
|
||||
:data-store_id="item.store_id"
|
||||
>
|
||||
<block
|
||||
v-if="
|
||||
item.if_gain &&
|
||||
item.activity_type != 4 &&
|
||||
item.activity_type != 3
|
||||
"
|
||||
>
|
||||
<label
|
||||
:class="['btn-coupon', item.if_gain ? '' : 'btn-coupon-gray']"
|
||||
>{{ __("立即领取") }}</label
|
||||
>
|
||||
<view class="m-coupon-btn" @click="doReceive" :data-isreceive="(item.if_gain ? '1' : '-1')" :data-id="(item.activity_id)" :data-point="(item.activity_rule.requirement.points.needed)" :data-store_id="(item.store_id)">
|
||||
<block v-if="(item.if_gain && item.activity_type != 4 && item.activity_type != 3)">
|
||||
<label :class="['btn-coupon', item.if_gain ? '' : 'btn-coupon-gray']">{{ __('立即领取')}}</label>
|
||||
</block>
|
||||
<block v-else-if="!item.if_gain">
|
||||
<label
|
||||
:class="['btn-coupon', item.if_gain ? '' : 'btn-coupon-gray']"
|
||||
>{{ __("已经领取") }}</label
|
||||
>
|
||||
<label
|
||||
:class="['btn-coupon', item.if_gain ? '' : 'btn-coupon-gray']"
|
||||
>{{ __("去消费") }}</label
|
||||
>
|
||||
<block v-else-if="(!item.if_gain)">
|
||||
<label :class="['btn-coupon', item.if_gain ? '' : 'btn-coupon-gray']">{{__('已经领取')}}</label>
|
||||
<label :class="['btn-coupon', item.if_gain ? '' : 'btn-coupon-gray']">{{__('去消费')}}</label>
|
||||
</block>
|
||||
<!-- <label :class="['btn-coupon', item.if_gain ? '' : 'btn-coupon-gray']">{{item.if_gain ? __('立即领取'):__('已经领取 去消费') }}</label> -->
|
||||
</view>
|
||||
<view
|
||||
class="m-coupon-btn"
|
||||
@click="doShare"
|
||||
:data-isreceive="item.if_gain ? '1' : '-1'"
|
||||
:data-voucher_price="item.activity_rule.voucher_price"
|
||||
:data-id="item.activity_id"
|
||||
:data-point="item.activity_rule.requirement.points.needed"
|
||||
:data-activity-name="item.activity_name"
|
||||
:data-store_id="item.store_id"
|
||||
>
|
||||
<block v-if="item.if_gain && item.activity_type === 4">
|
||||
<label
|
||||
:class="['btn-coupon', item.if_gain ? '' : 'btn-coupon-gray']"
|
||||
>{{ __("立即分享") }}</label
|
||||
>
|
||||
<view class="m-coupon-btn" @click="doShare" :data-isreceive="(item.if_gain ? '1' : '-1')" :data-voucher_price="(item.activity_rule.voucher_price)" :data-id="(item.activity_id)" :data-point="(item.activity_rule.requirement.points.needed)" :data-activity-name="(item.activity_name)" :data-store_id="(item.store_id)">
|
||||
<block v-if="(item.if_gain && item.activity_type === 4)">
|
||||
<label :class="['btn-coupon', item.if_gain ? '' : 'btn-coupon-gray']">{{ __('立即分享')}}</label>
|
||||
</block>
|
||||
</view>
|
||||
<view
|
||||
class="m-coupon-btn"
|
||||
@click="doBuy(item.item_id)"
|
||||
:data-isreceive="item.if_gain ? '1' : '-1'"
|
||||
:data-id="item.activity_id"
|
||||
:data-activity-name="item.activity_name"
|
||||
:data-store_id="item.store_id"
|
||||
>
|
||||
<block v-if="item.if_gain && item.activity_type === 3">
|
||||
<label
|
||||
:class="['btn-coupon', item.if_gain ? '' : 'btn-coupon-gray']"
|
||||
>{{ __("去购买") }}</label
|
||||
>
|
||||
<view class="m-coupon-btn" @click="doBuy(item.item_id)" :data-isreceive="(item.if_gain ? '1' : '-1')" :data-id="(item.activity_id)" :data-activity-name="(item.activity_name)" :data-store_id="(item.store_id)">
|
||||
<block v-if="(item.if_gain && item.activity_type === 3)">
|
||||
<label :class="['btn-coupon', item.if_gain ? '' : 'btn-coupon-gray']">{{ __('去购买')}}</label>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
</block>
|
||||
<view class="m-nullcontent" v-else>
|
||||
<view class="m-nullpage-middle">
|
||||
<label class="iconfont icon-meiyougengduo"></label>
|
||||
<view class="m-null-tip">
|
||||
<text>{{ __("亲~什么都没有") }}</text>
|
||||
<text>{{ __("没有可领的优惠券~") }}</text>
|
||||
<text>{{__('亲~什么都没有')}}</text>
|
||||
<text>{{__('没有可领的优惠券~')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="m-loading-box">
|
||||
<block v-if="ispage">
|
||||
<block v-if="(ispage)">
|
||||
<view class="u-loadmore">
|
||||
<label class="u-loading"></label>
|
||||
<text class="u-loadmore-tips">{{ __("正在加载") }}</text>
|
||||
<text class="u-loadmore-tips">{{__('正在加载')}}</text>
|
||||
</view>
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="u-loadmore u-loadmore-line">
|
||||
<text class="u-loadmore-tips">{{ __("没有更多数据啦!") }}</text>
|
||||
<text class="u-loadmore-tips">{{__('没有更多数据啦!')}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="msk1" v-if="!flags" @click="outertouch">
|
||||
<view class="msk1" v-if="(!flags)" @click="outertouch">
|
||||
<view class="m-coupon-box" @click.stop="innertouch">
|
||||
<view class="m-coupon-box-top"> </view>
|
||||
<view class="m-coupon-box-top">
|
||||
|
||||
</view>
|
||||
<view class="m-coupon-box-content">
|
||||
|
||||
<view class="m-coupon-box-title">
|
||||
{{ __("优惠券领取成功") }}
|
||||
<view class="m-coupon-box-tip">{{
|
||||
__("点击右上角分享给好友")
|
||||
}}</view>
|
||||
{{__('优惠券领取成功')}}
|
||||
<view class="m-coupon-box-tip">{{__('点击右上角分享给好友')}}</view>
|
||||
</view>
|
||||
<scroll-view scroll-y="true" class="m-coupon-box-list">
|
||||
<view
|
||||
class="m-coupon-box-item"
|
||||
v-for="(item, index) in Coupons"
|
||||
:key="index"
|
||||
>
|
||||
<view class="m-coupon-box-item" v-for="(item, index) in Coupons" :key="index">
|
||||
<label>{{item.activity_rule.voucher_price}}</label>
|
||||
<text>{{item.activity_name}}</text>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view class="m-coupon-box-bottom"> </view>
|
||||
<view class="m-coupon-box-bottom">
|
||||
|
||||
</view>
|
||||
<view class="closeRPK" @click.stop="outertouch">
|
||||
<image
|
||||
lazy-load
|
||||
style="width: 50rpx; height: 50rpx"
|
||||
src="/static/images/delete.png"
|
||||
></image>
|
||||
<image lazy-load style="width:50rpx;height:50rpx" src="/static/images/delete.png"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<!-- #ifdef APP-PLUS -->
|
||||
<share-box-app
|
||||
:shareDataDefault="shareData"
|
||||
ref="shareBoxApp"
|
||||
></share-box-app>
|
||||
<share-box-app :shareDataDefault="shareData" ref="shareBoxApp"></share-box-app>
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifdef H5 -->
|
||||
@ -215,42 +116,33 @@
|
||||
<!-- #endif -->
|
||||
|
||||
<!-- #ifndef APP-PLUS -->
|
||||
<share-box-mp
|
||||
:shareDataDefault="shareData"
|
||||
@showCodeImg="showCodeImg"
|
||||
@saveImg="saveImg"
|
||||
ref="shareBoxMp"
|
||||
></share-box-mp>
|
||||
<share-box-mp :shareDataDefault="shareData" @showCodeImg="showCodeImg" @saveImg="saveImg" ref="shareBoxMp"></share-box-mp>
|
||||
<!-- #endif -->
|
||||
<payment-box
|
||||
:paymentDataDefault="paymentData"
|
||||
:order_id="order_id"
|
||||
ref="paymentBox"
|
||||
@onCancel="onCancel"
|
||||
@onPaid="onPaid"
|
||||
@onFail="onFail"
|
||||
></payment-box>
|
||||
<payment-box :paymentDataDefault="paymentData" :order_id="order_id" ref="paymentBox" @onCancel="onCancel" @onPaid="onPaid" @onFail="onFail"></payment-box>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import $ from "../../helpers/util";
|
||||
import shareBoxMp from "../../components/share-box-mp.vue";
|
||||
import shareBoxApp from "../../components/share-box-app.vue";
|
||||
import shareBoxH5 from "../../components/share-box-h5.vue";
|
||||
import paymentBox from "../../components/payment-box.vue";
|
||||
import shareBoxMp from '../../components/share-box-mp.vue'
|
||||
import shareBoxApp from '../../components/share-box-app.vue'
|
||||
import shareBoxH5 from '../../components/share-box-h5.vue'
|
||||
import paymentBox from '../../components/payment-box.vue'
|
||||
|
||||
import { mapState, mapMutations } from "vuex";
|
||||
import {
|
||||
mapState,
|
||||
mapMutations
|
||||
} from 'vuex'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
shareData: {
|
||||
shareText: "东华汽车,支持原生App、微信小程序,邀请你一起体验!",
|
||||
shareTitle: "东华汽车,支持原生App、微信小程序,邀请你一起体验!",
|
||||
shareText: '东华汽车,支持原生App、微信小程序,邀请你一起体验!',
|
||||
shareTitle: '东华汽车,支持原生App、微信小程序,邀请你一起体验!',
|
||||
href: "https://www.suteshop.com",
|
||||
image: "",
|
||||
price: "",
|
||||
image: '',
|
||||
price: '',
|
||||
},
|
||||
tapindex: 0,
|
||||
page: 1,
|
||||
@ -274,7 +166,7 @@ export default {
|
||||
time: "",
|
||||
st: "",
|
||||
et: "",
|
||||
activity_type: 0,
|
||||
activity_type: 0
|
||||
};
|
||||
},
|
||||
|
||||
@ -282,17 +174,9 @@ export default {
|
||||
shareBoxMp,
|
||||
shareBoxApp,
|
||||
shareBoxH5,
|
||||
paymentBox,
|
||||
paymentBox
|
||||
},
|
||||
computed: mapState([
|
||||
"Config",
|
||||
"StateCode",
|
||||
"notice",
|
||||
"plantformInfo",
|
||||
"shopInfo",
|
||||
"userInfo",
|
||||
"hasLogin",
|
||||
]),
|
||||
computed: mapState(['Config', 'StateCode', 'notice', 'plantformInfo', 'shopInfo', 'userInfo', 'hasLogin']),
|
||||
onBackPress: function() {
|
||||
// #ifdef APP-PLUS
|
||||
if (this.$refs.shareBoxApp.showBoxView) {
|
||||
@ -301,6 +185,7 @@ export default {
|
||||
}
|
||||
// #endif
|
||||
|
||||
|
||||
// #ifdef H5
|
||||
if (this.$refs.shareBoxH5.showBoxView) {
|
||||
this.$refs.shareBoxH5.cancel();
|
||||
@ -342,7 +227,7 @@ export default {
|
||||
}
|
||||
// #endif
|
||||
// 离开页面,注销事件
|
||||
var that = this;
|
||||
var that = this
|
||||
this.notice.removeNotification("RefreshProduct", that);
|
||||
this.notice.removeNotification("GotoPayCheckout", that);
|
||||
if (this.$refs.paymentBox.showBoxView) {
|
||||
@ -351,60 +236,52 @@ export default {
|
||||
},
|
||||
onLoad: function(options) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.__("领取优惠券"),
|
||||
title: this.__('领取优惠券')
|
||||
});
|
||||
var that = this;
|
||||
|
||||
var n = new Date(),
|
||||
s = new Date(new Date().getTime() + 2 * 24 * 60 * 60 * 1000),
|
||||
r = new Date();
|
||||
var n = new Date,
|
||||
s = new Date((new Date).getTime() + 2 * 24 * 60 * 60 * 1000),
|
||||
r = new Date;
|
||||
var stdate = n.getFullYear() + "-" + (n.getMonth() + 1) + "-" + n.getDate(),
|
||||
sdate = s.getFullYear() + "-" + (s.getMonth() + 1) + "-" + s.getDate(),
|
||||
eddate =
|
||||
r.getFullYear() + 1 + "-" + (r.getMonth() + 1) + "-" + r.getDate();
|
||||
sdate = s.getFullYear() + "-" + (s.getMonth() + 1) + "-" + (s.getDate()),
|
||||
eddate = (r.getFullYear() + 1) + "-" + (r.getMonth() + 1) + "-" + r.getDate();
|
||||
|
||||
this.setData({
|
||||
options: options,
|
||||
VoucherList: [],
|
||||
stdate: stdate,
|
||||
date: sdate,
|
||||
eddate: eddate,
|
||||
});
|
||||
eddate: eddate
|
||||
})
|
||||
|
||||
var time = n.getHours() + ":" + n.getMinutes();
|
||||
var time = n.getHours() + ':' + n.getMinutes();
|
||||
|
||||
this.setData({
|
||||
time: time,
|
||||
st: time,
|
||||
et: time,
|
||||
});
|
||||
et: time
|
||||
})
|
||||
|
||||
$.isNull(this.userInfo)
|
||||
? this.getUserInfo(function () {
|
||||
that.getCouponlist();
|
||||
}, options.uid)
|
||||
: that.getCouponlist();
|
||||
|
||||
$.isNull(this.userInfo) ? this.getUserInfo(function() {
|
||||
that.getCouponlist()
|
||||
},
|
||||
options.uid) : that.getCouponlist()
|
||||
},
|
||||
onReachBottom: function() {
|
||||
this.scrollbottom();
|
||||
this.scrollbottom()
|
||||
},
|
||||
methods: {
|
||||
...mapMutations([
|
||||
"login",
|
||||
"logout",
|
||||
"getPlantformInfo",
|
||||
"forceUserInfo",
|
||||
"getUserInfo",
|
||||
"reloadUserResource",
|
||||
]),
|
||||
...mapMutations(['login', 'logout', 'getPlantformInfo', 'forceUserInfo', 'getUserInfo', 'reloadUserResource']),
|
||||
|
||||
doReceive: function(e) {
|
||||
|
||||
var that = this;
|
||||
if (e.currentTarget.dataset.isreceive == -1) {
|
||||
that.$.navigateTo({
|
||||
url:
|
||||
"/pagesub/index/store?store_id=" + e.currentTarget.dataset.store_id,
|
||||
});
|
||||
url: "/pagesub/index/store?store_id=" + e.currentTarget.dataset.store_id
|
||||
})
|
||||
return;
|
||||
}
|
||||
that.setData({
|
||||
@ -418,31 +295,16 @@ export default {
|
||||
doShare: function(e) {
|
||||
const user_id = this.userInfo.user_id;
|
||||
let that = this;
|
||||
var $href = that.$.sprintf(
|
||||
"%s/h5/pages/index/index?uid=%d&activity_id=%d",
|
||||
this.Config.WapSiteUrl,
|
||||
user_id,
|
||||
e.currentTarget.dataset.id
|
||||
);
|
||||
var $href = that.$.sprintf('%s/h5/pages/index/index?uid=%d&activity_id=%d', this.Config.WapSiteUrl, user_id, e.currentTarget.dataset.id);
|
||||
|
||||
$href = that.$.sprintf(
|
||||
"%s/h5/pages/index/index?uid=%d&activity_id=%d",
|
||||
that.Config.SiteUrl,
|
||||
user_id,
|
||||
e.currentTarget.dataset.id
|
||||
);
|
||||
$href = that.$.sprintf('%s/h5/pages/index/index?uid=%d&activity_id=%d', that.Config.SiteUrl, user_id, e.currentTarget.dataset.id);
|
||||
// 如允许点击超链接跳转,则应该打开一个新页面,并传入href,由新页面内嵌webview组件负责显示该链接内容
|
||||
// #ifdef APP-PLUS
|
||||
|
||||
// #endif
|
||||
|
||||
// #ifdef MP-WEIXIN
|
||||
$href = that.$.sprintf(
|
||||
"%s/pages/index/index?uid=%d&activity_id=%d",
|
||||
that.Config.SiteUrl,
|
||||
user_id,
|
||||
e.currentTarget.dataset.id
|
||||
);
|
||||
$href = that.$.sprintf("%s/pages/index/index?uid=%d&activity_id=%d", that.Config.SiteUrl, user_id, e.currentTarget.dataset.id);
|
||||
// $href = that.$.sprintf("%s/community/community/detail?id=%d", this.Config.SiteUrl, this.story_id);
|
||||
// #endif
|
||||
|
||||
@ -451,9 +313,9 @@ export default {
|
||||
shareTitle: e.currentTarget.dataset.activityName,
|
||||
shareText: e.currentTarget.dataset.activityName,
|
||||
href: $href,
|
||||
image: "",
|
||||
image: '',
|
||||
price: e.currentTarget.dataset.voucher_price,
|
||||
},
|
||||
}
|
||||
});
|
||||
|
||||
// 如允许点击超链接跳转,则应该打开一个新页面,并传入href,由新页面内嵌webview组件负责显示该链接内容
|
||||
@ -465,23 +327,23 @@ export default {
|
||||
path: $href,
|
||||
Path: $href,
|
||||
MainTitle: e.currentTarget.dataset.activityName,
|
||||
MainImg: "",
|
||||
MainPrice: e.currentTarget.dataset.voucher_price,
|
||||
MainImg: '',
|
||||
MainPrice: e.currentTarget.dataset.voucher_price
|
||||
},
|
||||
method: "POST",
|
||||
success: function(data, status, msg, code) {
|
||||
if (status == 200) {
|
||||
that.setData({
|
||||
shareData: {
|
||||
shareTitle: "优惠券",
|
||||
shareText: "优惠券",
|
||||
shareTitle: '优惠券',
|
||||
shareText: '优惠券',
|
||||
href: $href,
|
||||
image: data.poster_url,
|
||||
price: e.currentTarget.dataset.voucherPrice,
|
||||
},
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
this.$refs.shareBoxApp.show();
|
||||
// #endif
|
||||
@ -504,34 +366,34 @@ export default {
|
||||
this.$refs.shareBoxMp.show();
|
||||
// #endif
|
||||
}
|
||||
|
||||
},
|
||||
outertouch: function() {
|
||||
this.setData({
|
||||
flag: true,
|
||||
});
|
||||
flag: true
|
||||
})
|
||||
},
|
||||
innertouch: function() {
|
||||
this.setData({
|
||||
flag: false,
|
||||
});
|
||||
flag: false
|
||||
})
|
||||
},
|
||||
freeget: function() {
|
||||
this.setData({
|
||||
tapindex: 0,
|
||||
VoucherList: [],
|
||||
activity_type: 0,
|
||||
page: 1,
|
||||
}),
|
||||
this.getCouponlist();
|
||||
page: 1
|
||||
}), this.getCouponlist()
|
||||
},
|
||||
buyget: function() {
|
||||
this.setData({
|
||||
tapindex: 1,
|
||||
activity_type: 3,
|
||||
VoucherList: [],
|
||||
page: 1,
|
||||
page: 1
|
||||
}),
|
||||
this.getCouponlist();
|
||||
this.getCouponlist()
|
||||
},
|
||||
doBuy: function(item_id) {
|
||||
// this.$.gotopage('/pages/product/detail?pid=' + item_id)
|
||||
@ -541,14 +403,14 @@ export default {
|
||||
params.ifcart = 0; // 传入cart_id时直接购买,未传时走购物车
|
||||
params.cart_id = item_id + "|1";
|
||||
params.payment_type_id = that.StateCode.PAYMENT_TYPE_ONLINE;
|
||||
params.delivery_type_id = 16;
|
||||
params.delivery_type_id = 5;
|
||||
params.delivery_time_id = 1;
|
||||
params.invoice_type_id = 1;
|
||||
params.order_invoice_title = "";
|
||||
params.virtual_service_date = that.date;
|
||||
params.virtual_service_time = that.date + " " + that.time;
|
||||
params.distributor_id = uni.getStorageSync("store_id");
|
||||
let source_item_id = uni.getStorageSync("source_item_id");
|
||||
params.virtual_service_time = that.date + ' ' + that.time;
|
||||
params.distributor_id = uni.getStorageSync('store_id');
|
||||
let source_item_id = uni.getStorageSync('source_item_id');
|
||||
params.source_item_id = source_item_id;
|
||||
params.is_voucher = 1;
|
||||
params.is_delivery = 0; //是否自提
|
||||
@ -561,18 +423,9 @@ export default {
|
||||
//删除旧数据
|
||||
if (source_item_id) {
|
||||
let source_item_id_row = JSON.parse(source_item_id);
|
||||
for (
|
||||
let store_idx = 0;
|
||||
store_idx < data.items.length;
|
||||
store_idx++
|
||||
) {
|
||||
for (
|
||||
let item_idx = 0;
|
||||
item_idx < data.items[store_idx].items.length;
|
||||
item_idx++
|
||||
) {
|
||||
let order_item_id =
|
||||
data.items[store_idx].items[item_idx].item_id;
|
||||
for (let store_idx = 0; store_idx < data.items.length; store_idx++) {
|
||||
for (let item_idx = 0; item_idx < data.items[store_idx].items.length; item_idx++) {
|
||||
let order_item_id = data.items[store_idx].items[item_idx].item_id;
|
||||
|
||||
//完成后删除数据吧
|
||||
if (source_item_id) {
|
||||
@ -581,7 +434,7 @@ export default {
|
||||
if (tk == order_item_id) {
|
||||
delete source_item_id_row[tk];
|
||||
} else {
|
||||
let time = parseInt(Date.parse(new Date()) / 100);
|
||||
let time = parseInt(Date.parse(new Date()) / 100)
|
||||
//判断是否超时
|
||||
if (time - source_item_id_row[tk].t > 86400 * 30) {
|
||||
delete source_item_id_row[tk];
|
||||
@ -591,18 +444,17 @@ export default {
|
||||
delete source_item_id_row[tk];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
uni.setStorageSync(
|
||||
"source_item_id",
|
||||
JSON.stringify(source_item_id_row)
|
||||
);
|
||||
uni.setStorageSync('source_item_id', JSON.stringify(source_item_id_row));
|
||||
}
|
||||
|
||||
that.setData({
|
||||
order_id: data.order_id.join(","),
|
||||
order_id: data.order_id.join(','),
|
||||
});
|
||||
|
||||
if (data.gb_id) {
|
||||
@ -610,62 +462,61 @@ export default {
|
||||
}
|
||||
|
||||
that.setData({
|
||||
paymentData: {
|
||||
'paymentData': {
|
||||
order_id: that.order_id,
|
||||
orderSelMoneyAmount: data.orderSelMoneyAmount.toFixed(2),
|
||||
user_money: data.user_money,
|
||||
user_points: data.user_points,
|
||||
user_recharge_card: that.userInfo.user_recharge_card,
|
||||
user_sp: that.userInfo.user_sp,
|
||||
},
|
||||
user_sp: that.userInfo.user_sp
|
||||
}
|
||||
});
|
||||
|
||||
that.reloadUserResource(function (user_info) {});
|
||||
|
||||
that.reloadUserResource(function(user_info) {
|
||||
|
||||
});
|
||||
that.gotopay();
|
||||
// 判断如果是虚拟商品
|
||||
} else {
|
||||
if (
|
||||
(data && data.hasOwnProperty("mobile_is_bind")) ||
|
||||
code == 77011
|
||||
) {
|
||||
that.$.confirm(
|
||||
msg,
|
||||
if (data && data.hasOwnProperty('mobile_is_bind') || code == 77011) {
|
||||
that.$.confirm(msg,
|
||||
function(data) {
|
||||
if (data.confirm) {
|
||||
//绑定手机操作
|
||||
that.$.gopage("/member/member/bindphone");
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
true);
|
||||
} else {
|
||||
that.$.confirm(msg);
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
fail: function(data, status, msg, code) {
|
||||
that.$.showToast({
|
||||
title: msg,
|
||||
});
|
||||
},
|
||||
title: msg
|
||||
})
|
||||
}
|
||||
});
|
||||
} else {
|
||||
that.gotopay();
|
||||
that.gotopay()
|
||||
}
|
||||
},
|
||||
gotopay: function(e) {
|
||||
setTimeout(() => {
|
||||
this.$refs.paymentBox.show();
|
||||
}, 400);
|
||||
}, 400)
|
||||
|
||||
return true;
|
||||
|
||||
var param = {
|
||||
order_id: this.order_id,
|
||||
openid: this.userInfo.openId,
|
||||
typ: "json",
|
||||
payment_channel_code: "wx_native",
|
||||
prepay_flag: 1,
|
||||
typ: 'json',
|
||||
payment_channel_code: 'wx_native',
|
||||
prepay_flag: 1
|
||||
};
|
||||
|
||||
var that = this;
|
||||
@ -679,16 +530,16 @@ export default {
|
||||
that.$.requestPayment({
|
||||
timeStamp: data.timeStamp,
|
||||
nonceStr: data.nonceStr,
|
||||
package: data.package,
|
||||
"package": data.package,
|
||||
signType: data.signType,
|
||||
paySign: data.paySign,
|
||||
success: function(n) {
|
||||
that.isTmplMsg && that.sendMessage(param.order_id, 2);
|
||||
that.returnUrl(param.order_id);
|
||||
that.returnUrl(param.order_id)
|
||||
},
|
||||
fail: function(n) {
|
||||
that.$.gotopage("/member/order/detail?on=" + param.order_id);
|
||||
that.isTmplMsg && that.sendMessage(param.order_id, 1);
|
||||
that.isTmplMsg && that.sendMessage(param.order_id, 1)
|
||||
},
|
||||
complete: function(n) {
|
||||
if (n.errMsg == "requestPayment:cancel") {
|
||||
@ -696,14 +547,14 @@ export default {
|
||||
|
||||
that.isTmplMsg && that.sendMessage(param.order_id, 1);
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
})
|
||||
} else {
|
||||
that.$.alert(msg);
|
||||
that.$.alert(msg)
|
||||
}
|
||||
},
|
||||
|
||||
fail: function (err) {},
|
||||
fail: function(err) {}
|
||||
});
|
||||
},
|
||||
onCancel: function(e) {},
|
||||
@ -716,45 +567,43 @@ export default {
|
||||
},
|
||||
onFail: function(e) {
|
||||
let that = this;
|
||||
that.$.gotopage("/member/order/detail?on=" + this.order_id);
|
||||
that.$.gotopage("/member/order/detail?on=" + this.order_id)
|
||||
},
|
||||
returnUrl: function(e) {
|
||||
var that = this;
|
||||
|
||||
if (that.isFightGroup) {
|
||||
that.$.gotopage(
|
||||
"/activity/fightgroup/detail?gb_id=" + that.isFightGroup + "&on=" + e
|
||||
);
|
||||
that.$.gotopage("/activity/fightgroup/detail?gb_id=" + that.isFightGroup + "&on=" + e);
|
||||
} else {
|
||||
that.$.gotopage("/member/order/detail?on=" + e);
|
||||
}
|
||||
|
||||
return;
|
||||
return
|
||||
|
||||
if (!that.$.isNull(that.spinfo)) {
|
||||
var n = JSON.parse(that.spinfo);
|
||||
if (n.isFightGroup == 2) {
|
||||
if (n.isOwner) {
|
||||
that.$.gotopage("/activity/fightgroup/detail?on=" + e);
|
||||
return;
|
||||
return
|
||||
}
|
||||
that.$.navigateBack(1, function() {
|
||||
this.notice.postNotificationName("RefreshFG");
|
||||
this.notice.postNotificationName("RefreshFG")
|
||||
});
|
||||
return;
|
||||
return
|
||||
}
|
||||
that.$.gotopage("/member/order/detail?on=" + e);
|
||||
return;
|
||||
return
|
||||
}
|
||||
that.$.gotopage("/member/order/detail?on=" + e);
|
||||
return;
|
||||
return
|
||||
},
|
||||
getCouponlist: function() {
|
||||
var params = {
|
||||
page: this.page,
|
||||
rows: this.rows,
|
||||
activity_type: this.activity_type,
|
||||
store_id: this.options.store_id,
|
||||
store_id: this.options.store_id
|
||||
},
|
||||
that = this;
|
||||
$.request({
|
||||
@ -767,55 +616,47 @@ export default {
|
||||
if (200 == status) {
|
||||
if (data.items.length > 0) {
|
||||
for (let i = 0; data.items.length > i; i++) {
|
||||
data.items[i].activity_endtime = new Date(
|
||||
data.items[i].activity_endtime
|
||||
)
|
||||
.toLocaleString()
|
||||
.replace(/:\d{1,2}$/, " ");
|
||||
data.items[i].activity_endtime = new Date(data.items[i].activity_endtime).toLocaleString().replace(/:\d{1,2}$/, ' ');
|
||||
// this.$.dateFormatter(data.items[i].activity_endtime);
|
||||
}
|
||||
if (data.page >= data.total) {
|
||||
that.setData({
|
||||
VoucherList: that.VoucherList.concat(data.items),
|
||||
flag: false,
|
||||
ispage: false,
|
||||
});
|
||||
ispage: false
|
||||
})
|
||||
} else {
|
||||
that.setData({
|
||||
VoucherList: that.VoucherList.concat(data.items),
|
||||
flag: true,
|
||||
ispage: true,
|
||||
});
|
||||
ispage: true
|
||||
})
|
||||
}
|
||||
} else {
|
||||
that.setData({
|
||||
flag: false,
|
||||
ispage: false,
|
||||
});
|
||||
ispage: false
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
fail: function(data) {
|
||||
that.setData({
|
||||
flag: false,
|
||||
ispage: false,
|
||||
});
|
||||
},
|
||||
ispage: false
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
getUserReceiveCoupon: function() {
|
||||
var point = this.needed_point,
|
||||
that = this;
|
||||
if (point > 0) {
|
||||
$.confirm(
|
||||
that.sprintf(that.__("确定消耗 %d 兑换优惠券?"), point),
|
||||
function (e) {
|
||||
$.confirm(that.sprintf(that.__('确定消耗 %d 兑换优惠券?'), point), function(e) {
|
||||
if (e.confirm) {
|
||||
that.addVoucher();
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
}, true);
|
||||
} else {
|
||||
that.addVoucher();
|
||||
}
|
||||
@ -825,7 +666,7 @@ export default {
|
||||
var params = {
|
||||
activity_id: this.Id,
|
||||
Code: this.Code,
|
||||
user_is_new: 0,
|
||||
user_is_new: 0
|
||||
};
|
||||
$.request({
|
||||
url: this.Config.URL.user.voucher_add,
|
||||
@ -835,11 +676,14 @@ export default {
|
||||
that.$.confirm(that.__("领取成功!去消费"), function(a) {
|
||||
if (a.confirm) {
|
||||
that.$.navigateTo({
|
||||
url: "/pagesub/index/store?store_id=" + that.store_id,
|
||||
});
|
||||
url: "/pagesub/index/store?store_id=" + that.store_id
|
||||
})
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
// that.getCouponlist()
|
||||
} else {
|
||||
// $.alert(msg);
|
||||
@ -861,15 +705,15 @@ export default {
|
||||
// #ifdef MP-WEIXIN
|
||||
wx.showShareMenu({
|
||||
withShareTicket: true,
|
||||
menus: ["shareAppMessage", "shareTimeline"],
|
||||
menus: ['shareAppMessage', 'shareTimeline']
|
||||
});
|
||||
// #endif
|
||||
|
||||
return {
|
||||
title: this.shopInfo.store_name,
|
||||
desc: this.shopInfo.VendorInfo,
|
||||
path: "/activity/coupon/list?uid=" + this.userInfo.user_id,
|
||||
};
|
||||
path: "/activity/coupon/list?uid=" + this.userInfo.user_id
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
@ -879,16 +723,16 @@ export default {
|
||||
return {
|
||||
title: this.shopInfo.store_name,
|
||||
query: {
|
||||
uid: this.userInfo.user_id,
|
||||
},
|
||||
};
|
||||
uid: this.userInfo.user_id
|
||||
}
|
||||
}
|
||||
},
|
||||
receivenowWeixin: function(e) {
|
||||
// //console.log("领取卡券:", e.currentTarget.dataset.cardid);
|
||||
var that = this,
|
||||
params = {
|
||||
activity_id: e.currentTarget.dataset.cardid,
|
||||
openid: this.userInfo.openId,
|
||||
openid: this.userInfo.openId
|
||||
};
|
||||
// 微信卡券
|
||||
/*$.xsr($.makeUrl(userapi.receiveWeixinCoupons, n), function (n) {
|
||||
@ -918,19 +762,18 @@ export default {
|
||||
if (this.flag) {
|
||||
var e = this;
|
||||
e.setData({
|
||||
flag: false,
|
||||
}),
|
||||
clearTimeout(t);
|
||||
flag: false
|
||||
}), clearTimeout(t);
|
||||
var t = setTimeout(function() {
|
||||
e.setData({
|
||||
page: parseInt(e.page) + 1,
|
||||
}),
|
||||
e.getCouponlist();
|
||||
}, 500);
|
||||
page: parseInt(e.page) + 1
|
||||
}), e.getCouponlist()
|
||||
},
|
||||
500)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@ -967,7 +810,7 @@ export default {
|
||||
right: 0;
|
||||
height: 6rpx;
|
||||
border-bottom: 6rpx solid $default-skin-bg;
|
||||
color: #cccccc;
|
||||
color: #CCCCCC;
|
||||
-webkit-transform-origin: 0 100%;
|
||||
transform-origin: 0 100%;
|
||||
-webkit-transform: scaleY(0.5);
|
||||
@ -986,23 +829,21 @@ export default {
|
||||
}
|
||||
|
||||
.m-coupon-list {
|
||||
margin-top: 36rpx;
|
||||
margin-top: 36rpx
|
||||
}
|
||||
|
||||
.m-coupon-item {
|
||||
width: 700rpx;
|
||||
height: 192rpx;
|
||||
margin: 10rpx auto;
|
||||
background: url(https://static.lancerdt.com/xcxfile/appicon/Coupon_V2.png)
|
||||
no-repeat;
|
||||
background: url(https://static.lancerdt.com/xcxfile/appicon/Coupon_V2.png) no-repeat;
|
||||
background-size: contain;
|
||||
box-sizing: border-box;
|
||||
padding: 12rpx;
|
||||
}
|
||||
|
||||
.m-coupon-item.off {
|
||||
background: url(https://static.lancerdt.com/xcxfile/appicon/Coupon_off.png)
|
||||
no-repeat;
|
||||
background: url(https://static.lancerdt.com/xcxfile/appicon/Coupon_off.png) no-repeat;
|
||||
background-size: contain;
|
||||
}
|
||||
|
||||
@ -1089,5 +930,6 @@ export default {
|
||||
left: 50%;
|
||||
margin-left: -30rpx;
|
||||
bottom: -80rpx;
|
||||
|
||||
}
|
||||
</style>
|
||||
3877
address/citys.js
@ -1,488 +0,0 @@
|
||||
<template>
|
||||
<view class="nyn-city-list-container">
|
||||
<!-- 搜索框 -->
|
||||
<!-- <view class="search">
|
||||
<input
|
||||
type="text"
|
||||
placeholder="请输入城市名称"
|
||||
placeholder-style="font-size:20rpx"
|
||||
@input="bindinputCitys"
|
||||
/>
|
||||
</view> -->
|
||||
<uni-nav-bar
|
||||
title=""
|
||||
:fixed="true"
|
||||
:border="false"
|
||||
:left-width="'60rpx'"
|
||||
:right-width="'160rpx'"
|
||||
:statusBar="true"
|
||||
:height="'34px'"
|
||||
>
|
||||
<block slot="left">
|
||||
<view class="left-block" @click="handerSkip">
|
||||
<image
|
||||
style="
|
||||
width: 11px;
|
||||
height: 18px;
|
||||
vertical-align: middle;
|
||||
margin-left: 6px;
|
||||
"
|
||||
lazy-load
|
||||
src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAA2CAYAAABJN/BMAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAIaADAAQAAAABAAAANgAAAADEgMuSAAAF8ElEQVRYCc2Ya2hcVRDHk91sHo3mTR5rbJrnapsYTKIfWmMSapWKICJCoeCHfgqCKGh9VFRE1FiFopQYEbRYW1SsobVfpFahjRoxEYvGmDQJeZAHTbJ5rtnNY9ffhNzl3JtNzN3cBA8Md86ce2b+Z2bOnHNvRMT/oNm3GUNkXl7ezvj4+Pnp6elFzbZNY7bjWVBQsBs756Kjo4+q9rbLEzY8UBwIBC5iXIDUJCcnBwDT4vF4FrYDhC0/P78qMjLyE4wXKB4oi42NbXe73e1bHo7CwsI78EA9dJsCIAJQP8fExDQhC0SqAxbzNnKgVEIAORXdC/CXvF7vY0NDQ/+IfKs8YcMD+/1+/xchAHyJ7IgGQEBsiSdIwrvQfRbKV20Qgkb6td3d3Td4BltUkLOGseOBiqWlpQuoS1dUzsNfIBEPt7W1Ca9rVobDjgceIATiASOAz9iOtaEACBrLwsE23Eusz6Azx6D3bFxc3JMAcIvBUM0KT9iLioruAcA3GNgFaQvzkQOny8vLH18PgIDSJggfTrOzDR8iBO8zeaeiwAf/8eLi4kv9/f0Tijwku6mKCYAqPPARmm+FggvCA6cA9kJfX99kSKsGYXCiQb5ut7q6OmpgYKCSlxoBkai87AXAp11dXbU8A4p8XdZ0TgiAwcHBh9F62gjAZrN9gPGjZgAIOtPhiIqKug/jH0K3qMvDcD30Kl6YVuUb4TccDrLcMTk5uR/jX6E4XlE+B99AFXzGrAc0HRsKxwqARwEgx7EKQA6g96gDr4QLQIBsKBwYeZB366FMmaS0dxl7kzowq8hMs+uGQzwwNTV1UE5DNMcq2j2s/AQheFmRhc2uGY4VAIcAIHVAB4D+O7Ozs3VhWzVMXDMcuPkRckAqoXoYRbAN6+bm5o6PjIxIPljSVoXD6XTuAMATeOA4LlfH5+ieJATPWWJZUaK7TwgAzvyn8MAxAwAvHmiw2+2vK3MtY3UgAHAQzc9DNxksnMMzr1GIZgxyS7q6xGT1slL1LFg2gtxJpTQCswSAKNGBoH8V8suA2ghPJVe2Ezk5OVmq3CpetzsSExNbiL3cC+QrSU1KAetibA/fkY3qd6QVQHQgOBtmU1JSrqD4dqgAUj0lfCFhKUlNTb3Ml5NlW1QHAiMRExMTHlb7LTshmW4JpEte+nlQVkZGxtWxsTE5vDbdVoEQjbh7jtA04X5JxnJIfU/43eyW3NLS0vO9vb2rcohxU01VrptIaLxc4a/4fL4MBooh1SMyr5hzJQ+wP8i7uskmO2uCED3Dw8MLGPmOLSrdOyH1DBGZizG+8pN/JIxyuQ2rqYkXUgHu9s7Pz7/N4FuQMRljkB0BSB3bWN1NIXWtJTQz0c4HzosYC1VR5VP/JDvnWEdHh+mqum44DMgDuLwpLS3NDRBJ1psN4yXIYzl/mkdHR1d9bxre1XXNgJCJgdzc3Gskq3xV10Bqjjjol7FrHNSQy/AbbmZBSLL68cg1knGAEFRhaYdizYE3Kil4dq4Dv8zMzMgPkf9spkFoGgHyB8Y66UtoUjX5yrPC4XD4AdKyESBhgxBjALlOCf+b1R+gq56y0cju5neAh3d+WgG25mNTINAaIP7deKSZ0AiQBGh5x9GPhr8fkFMJCQm/U9CCP0+R69pmQSwrY7UDGGtm9aUInFBw6yPbB6AZit6aQCwBIUjwyBBAfsWo7Jo0ka00KWh7oRG88ZsmVJ9BxKpwM7zL5crlv8R5wOxBj1qR/XhEquvnXBN1Jd4yT2jAx8fHJ9PT07+nXriQ7VKAyILlz+6NrKysPyloS/SXm+UgRCtA3ABpAkgFXfmHpbU4mH1cFa8Tvr80oeXh0BTLk6uAXJrPQfdCUlG1No9HDiUlJV1sbW3d2h/s7BpfZmbmJVYu/zLkyqh5Xp41nM49eKRDTRwNpaXP9vb2YU7Xp1n51wbFEhrZOf4tByGGOzs7x8rKyg7DnoLkFuaB3mCXnOEZ/kWEyaab5AgeeZbtO9zT09OAgk3fT02DkAnZ2dlx8vNNnfwvwX82xj5+deEAAAAASUVORK5CYII="
|
||||
/>
|
||||
</view>
|
||||
</block>
|
||||
<view class="input-view">
|
||||
<uni-icons
|
||||
type="search"
|
||||
size="22"
|
||||
color="#666666"
|
||||
style="line-height: 60rpx"
|
||||
/>
|
||||
<input
|
||||
confirm-type="search"
|
||||
class="input"
|
||||
type="text"
|
||||
placeholder="输入城市名进行搜索"
|
||||
@input="bindinputCitys"
|
||||
/>
|
||||
</view>
|
||||
</uni-nav-bar>
|
||||
<!-- 热门城市 -->
|
||||
<view class="ynq-AutoAddress">
|
||||
<text class="iconfontAili icon-dingwei1"></text>
|
||||
<text style="margin: 0 12rpx">当前定位城市</text>
|
||||
<text>{{ loactionCity }}</text>
|
||||
</view>
|
||||
<text>热门城市</text>
|
||||
<view class="hot">
|
||||
<view
|
||||
class="hot-item"
|
||||
v-for="item in hotList"
|
||||
:key="item.id"
|
||||
@tap="bindCity(item)"
|
||||
:data-city="item.name"
|
||||
>{{ item.name }}</view
|
||||
>
|
||||
</view>
|
||||
<!-- 首字母检索 -->
|
||||
<view class="searchLetter touchClass">
|
||||
<!-- 右边字母数据数据 触摸事件-->
|
||||
<view
|
||||
v-for="item in searchLetter"
|
||||
:key="item.name"
|
||||
:data-letter="item.name"
|
||||
:style="{ height: `${itemH}px` }"
|
||||
@touchstart.stop="searchStart"
|
||||
@touchmove.stop="searchMove"
|
||||
@touchend.stop="searchEnd"
|
||||
>{{ item.name }}</view
|
||||
>
|
||||
</view>
|
||||
<!-- 左边字母跟右边字母true时 屏幕中心显示选中的首字母-->
|
||||
<!-- 居中首字母样式 -->
|
||||
<view class="cont_Letter" v-if="isShowLetter">
|
||||
{{ showLetter }}
|
||||
</view>
|
||||
<scroll-view
|
||||
scroll-y="true"
|
||||
:style="{ height: `${winHeight}px` }"
|
||||
:scroll-top="scrollTop"
|
||||
enhanced
|
||||
:show-scrollbar="false"
|
||||
v-if="!search"
|
||||
>
|
||||
<!-- 循环城市数据 -->
|
||||
<view v-for="(value, key) in cityList" :key="key">
|
||||
<!-- 循环首字母检索信息 -->
|
||||
<view class="list_letter">{{ key }}</view>
|
||||
<!-- 城市ID城市名称 -->
|
||||
<view
|
||||
class="item_city"
|
||||
v-for="item in value"
|
||||
:key="item.id"
|
||||
:data-city="item.name"
|
||||
@tap="bindCity(item)"
|
||||
>{{ item.name }}</view
|
||||
>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<!-- 搜索列表 -->
|
||||
<view class="list" v-if="search">
|
||||
<view
|
||||
class="text"
|
||||
v-for="item in searchList"
|
||||
:key="item.id"
|
||||
@tap="bindCity(item)"
|
||||
:data-city="item.name"
|
||||
>{{ item.name }}</view
|
||||
>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import address from "./citys.js";
|
||||
export default {
|
||||
name: "NynCityList",
|
||||
props: {
|
||||
hot: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isShowLetter: false, //拖动时,是否显示中间字母
|
||||
showLetter: "A", //中间字母
|
||||
searchLetter: [], //字母检索列表
|
||||
itemH: 0, //字母列表的高度
|
||||
startPageY: 0, //开始拖动字母时Y坐标
|
||||
bHeight: 0,
|
||||
tHeight: 0,
|
||||
CityName: "",
|
||||
scrollTop: 0, //城市列表容器滚动条的位置
|
||||
winHeight: 0, //城市列表窗口高度
|
||||
cityList: [], //城市列表
|
||||
hotList: [], //热门列表
|
||||
search: false, //是否搜索
|
||||
searchList: [],
|
||||
time: 0,
|
||||
loactionCity: "无法定位",
|
||||
isAdd: false,
|
||||
};
|
||||
},
|
||||
onShow() {
|
||||
let currentAddress = uni.getStorageSync("currentAddress");
|
||||
let loactionCity = uni.getStorageSync("loactionCity");
|
||||
if (currentAddress) {
|
||||
if (currentAddress.area) {
|
||||
this.loactionCity = currentAddress.area;
|
||||
}
|
||||
|
||||
if (!currentAddress.area && currentAddress.city) {
|
||||
this.loactionCity = currentAddress.city;
|
||||
}
|
||||
|
||||
if (!currentAddress.area && !currentAddress.city && currentAddress.addr) {
|
||||
let regex = /(\S+市)/g;
|
||||
let matches = currentAddress.addr.match(regex);
|
||||
if (matches && matches.length > 0) {
|
||||
let firstMatch = matches[0]; // 第一个匹配的“xx市”
|
||||
this.loactionCity = firstMatch;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.loactionCity = loactionCity;
|
||||
},
|
||||
onLoad(options) {
|
||||
if (options.isAdd) {
|
||||
this.isAdd = options.isAdd;
|
||||
}
|
||||
this.initList();
|
||||
},
|
||||
methods: {
|
||||
handerSkip() {
|
||||
uni.navigateBack();
|
||||
},
|
||||
/* 列表初始化 */
|
||||
initList() {
|
||||
let searchLetter = [];
|
||||
for (let key in address.cities) {
|
||||
searchLetter.push(key);
|
||||
}
|
||||
let hotList = address.hotCities;
|
||||
let cityList = address.cities;
|
||||
let sysInfo = uni.getSystemInfoSync();
|
||||
let winHeight = sysInfo.windowHeight;
|
||||
//添加要匹配的字母范围值
|
||||
//更加屏幕高度设置子元素的高度
|
||||
let itemH = winHeight / searchLetter.length;
|
||||
let tempObj = [];
|
||||
for (let i = 0; i < searchLetter.length; i++) {
|
||||
let temp = {};
|
||||
temp.name = searchLetter[i];
|
||||
temp.tHeight = i * itemH;
|
||||
temp.bHeight = (i + 1) * itemH;
|
||||
tempObj.push(temp);
|
||||
}
|
||||
this.winHeight = winHeight;
|
||||
this.itemH = itemH - "20";
|
||||
this.searchLetter = tempObj;
|
||||
this.cityList = cityList;
|
||||
this.hotList = hotList;
|
||||
},
|
||||
/* 搜索城市时触发 */
|
||||
bindinputCitys(e) {
|
||||
if (this.time !== null) {
|
||||
clearTimeout(this.time);
|
||||
}
|
||||
|
||||
this.time = setTimeout(() => {
|
||||
if (e.detail.value != "") {
|
||||
this.search = true;
|
||||
} else {
|
||||
this.search = false;
|
||||
}
|
||||
let cities = this.cityList;
|
||||
let cyits = [];
|
||||
for (let key in cities) {
|
||||
for (let i = 0; i < cities[key].length; i++) {
|
||||
if (
|
||||
cities[key][i].name.search(e.detail.value) != -1 ||
|
||||
cities[key][i].spell.search(e.detail.value) != -1
|
||||
) {
|
||||
cyits.push(cities[key][i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
this.searchList = cyits;
|
||||
}, 300);
|
||||
},
|
||||
/* 检索字母拖动开始 */
|
||||
searchStart(e) {
|
||||
let showLetter = e.currentTarget.dataset.letter;
|
||||
let pageY = e.touches[0].pageY;
|
||||
this.setScrollTop(showLetter);
|
||||
this.nowLetter(pageY);
|
||||
this.showLetter = showLetter;
|
||||
this.startPageY = pageY;
|
||||
this.isShowLetter = true;
|
||||
// let pageY = e.touches[0].pageY;
|
||||
// this.nowLetter(pageY);
|
||||
// this.startPageY = pageY;
|
||||
// this.isShowLetter = true
|
||||
},
|
||||
/* 检索字母拖动中 */
|
||||
searchMove(e) {
|
||||
let pageY = e.touches[0].pageY;
|
||||
let startPageY = this.startPageY;
|
||||
let tHeight = this.tHeight;
|
||||
let bHeight = this.bHeight;
|
||||
// let showLetter = 0;
|
||||
if (startPageY - pageY > 0) {
|
||||
//向上移动
|
||||
if (pageY < tHeight) {
|
||||
this.nowLetter(pageY);
|
||||
}
|
||||
} else {
|
||||
//向下移动
|
||||
if (pageY > bHeight) {
|
||||
this.nowLetter(pageY);
|
||||
}
|
||||
}
|
||||
},
|
||||
/* 检索字母拖动结束 */
|
||||
searchEnd() {
|
||||
setTimeout(() => {
|
||||
this.isShowLetter = false;
|
||||
}, 1000);
|
||||
},
|
||||
/* 点击城市 */
|
||||
bindCity(item) {
|
||||
// 向外传递这个城市
|
||||
// this.$emit("bindCity", item);
|
||||
uni.setStorageSync("city", item.name);
|
||||
uni.navigateBack();
|
||||
},
|
||||
/* 设置scroll-view滚动距离 */
|
||||
setScrollTop(showLetter) {
|
||||
let scrollTop = 0;
|
||||
let cityList = this.cityList;
|
||||
let cityCount = 0;
|
||||
let initialCount = 0;
|
||||
for (let key in cityList) {
|
||||
if (showLetter == key) {
|
||||
scrollTop = initialCount * 30 + cityCount * 41;
|
||||
break;
|
||||
} else {
|
||||
initialCount++;
|
||||
cityCount += cityList[key].length;
|
||||
}
|
||||
}
|
||||
this.scrollTop = scrollTop;
|
||||
},
|
||||
/* */
|
||||
nowLetter(pageY) {
|
||||
let letterData = this.searchLetter;
|
||||
let bHeight = 0;
|
||||
let tHeight = 0;
|
||||
let showLetter = "";
|
||||
for (let i = 0; i < letterData.length; i++) {
|
||||
if (letterData[i].tHeight <= pageY && pageY <= letterData[i].bHeight) {
|
||||
bHeight = letterData[i].bHeight;
|
||||
tHeight = letterData[i].tHeight;
|
||||
showLetter = letterData[i].name;
|
||||
break;
|
||||
}
|
||||
}
|
||||
// this.setScrollTop(showLetter);
|
||||
this.bHeight = bHeight;
|
||||
this.tHeight = tHeight;
|
||||
this.showLetter = showLetter;
|
||||
this.startPageY = pageY;
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.nyn-city-list-container {
|
||||
padding: 0 48rpx;
|
||||
background: #fff;
|
||||
height: 100%;
|
||||
overflow: hidden;
|
||||
|
||||
.ynq-AutoAddress {
|
||||
margin: 48rpx 0;
|
||||
}
|
||||
|
||||
/* 隐藏滚动条 */
|
||||
.scroll-view {
|
||||
scrollbar-width: none; /* Firefox */
|
||||
}
|
||||
|
||||
.scroll-view::-webkit-scrollbar {
|
||||
display: none; /* Chrome, Safari */
|
||||
}
|
||||
|
||||
.input-view {
|
||||
width: 92%;
|
||||
display: flex;
|
||||
background-color: #f5f5f5;
|
||||
height: 60rpx;
|
||||
border-radius: 30rpx;
|
||||
padding: 0 4%;
|
||||
flex-wrap: nowrap;
|
||||
margin: 10rpx 0;
|
||||
line-height: 60rpx;
|
||||
margin-left: 10rpx;
|
||||
color: #b9b9b9;
|
||||
}
|
||||
|
||||
.input-view .uni-icon {
|
||||
line-height: 60rpx !important;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.input-view .uni-icons {
|
||||
font-size: 32rpx !important;
|
||||
}
|
||||
|
||||
.input-view .input {
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
width: 94%;
|
||||
padding: 0 2%;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
.search {
|
||||
background-color: #ffffff;
|
||||
border: 1px solid #cccccc;
|
||||
width: 686rpx;
|
||||
border-radius: 100rpx;
|
||||
margin: 20rpx auto;
|
||||
padding: 4rpx;
|
||||
input {
|
||||
line-height: 60rpx;
|
||||
text-align: left;
|
||||
padding-left: 20rpx;
|
||||
}
|
||||
}
|
||||
/* 首字母样式 */
|
||||
.searchLetter {
|
||||
position: fixed;
|
||||
right: 0;
|
||||
top: 20%;
|
||||
width: 30px;
|
||||
height: 80%;
|
||||
text-align: center;
|
||||
justify-content: center;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
color: #666;
|
||||
background-color: #fff;
|
||||
z-index: 1;
|
||||
view {
|
||||
height: 50rpx;
|
||||
}
|
||||
}
|
||||
/* 右边首字母样式 */
|
||||
.touchClass {
|
||||
color: #666;
|
||||
font-size: 28rpx;
|
||||
}
|
||||
/* 居中显示的选中首字母 */
|
||||
.cont_Letter {
|
||||
background-color: #666;
|
||||
color: #fff;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
position: fixed;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
margin: -50px;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
border-radius: 10px;
|
||||
font-size: 26px;
|
||||
z-index: 1;
|
||||
}
|
||||
/* 循环数据首字母检索 */
|
||||
.list_letter {
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
height: 30px;
|
||||
color: #2a2a2a;
|
||||
font-size: 26rpx;
|
||||
align-items: center;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
}
|
||||
/* 城市样式 */
|
||||
.item_city {
|
||||
display: flex;
|
||||
background-color: #fff;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
color: #2a2a2a;
|
||||
font-size: 28rpx;
|
||||
align-items: center;
|
||||
border-bottom: 1px solid #f8f8f8;
|
||||
}
|
||||
.hot {
|
||||
background: #ffffff;
|
||||
display: flex;
|
||||
flex-flow: wrap;
|
||||
margin: 10px 0px;
|
||||
justify-content: space-between;
|
||||
|
||||
.hot-item {
|
||||
font-size: 28rpx;
|
||||
padding: 4px 11px;
|
||||
border-radius: 6px;
|
||||
margin-bottom: 8px;
|
||||
background: #f5f5f6;
|
||||
width: 17%;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
.list {
|
||||
.eng {
|
||||
background: #ffffff;
|
||||
padding: 30rpx;
|
||||
color: #212121;
|
||||
}
|
||||
.text {
|
||||
color: #212121;
|
||||
font-size: 28rpx;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
border-bottom: 1px solid #e6e6e6;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -1,867 +0,0 @@
|
||||
<template>
|
||||
<view class="address-container">
|
||||
<view class="hander">
|
||||
<uni-nav-bar
|
||||
title=""
|
||||
:fixed="true"
|
||||
:statusBar="false"
|
||||
:border="false"
|
||||
:left-width="'132rpx'"
|
||||
:right-width="'0rpx'"
|
||||
>
|
||||
<block slot="left">
|
||||
<view class="left-block" @click="handerSkip">
|
||||
<text class="iconfontAili icon-dingwei1"></text>
|
||||
<text class="city-block">{{
|
||||
originalData.result.addressComponent.city
|
||||
}}</text>
|
||||
<text class="iconfontAili icon-xiala"></text>
|
||||
</view>
|
||||
</block>
|
||||
<view class="input-view">
|
||||
<uni-icons
|
||||
type="search"
|
||||
size="22"
|
||||
color="#666666"
|
||||
style="line-height: 60rpx"
|
||||
/>
|
||||
<input
|
||||
confirm-type="search"
|
||||
class="input"
|
||||
type="text"
|
||||
placeholder="请输入收货地址"
|
||||
@click="onSearch"
|
||||
@input="handerAddress"
|
||||
/>
|
||||
</view>
|
||||
</uni-nav-bar>
|
||||
</view>
|
||||
<scroll-view
|
||||
v-if="!showSearchAddress"
|
||||
class="uni-swiper-list"
|
||||
scroll-y
|
||||
@scroll="onScroll"
|
||||
scroll-with-animation="true"
|
||||
:scroll-top="scrollTop"
|
||||
>
|
||||
<view class="address-block">
|
||||
<view class="address-box">
|
||||
<view class="address-left-block">{{
|
||||
originalData.result.sematic_description
|
||||
}}</view>
|
||||
<view class="address-right-block" @click="anewLoction">
|
||||
<text class="iconfontAili icon-zhongxindingwei"></text>
|
||||
<view style="padding-left: 8rpx">重新定位</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="list-block"
|
||||
v-if="userInfo.token && formatAddreesList.length > 0"
|
||||
>
|
||||
<view class="list-title-block">
|
||||
<text class="iconfontAili icon-dianpu"></text>
|
||||
<text class="title-block">我的收货地址</text>
|
||||
</view>
|
||||
<view
|
||||
class="list-item"
|
||||
v-for="(item, index) of formatAddreesList"
|
||||
:key="index"
|
||||
@click="handerSetAddress(item, 'my')"
|
||||
>
|
||||
<view class="item-info">
|
||||
<text
|
||||
:class="['item-lable', lableCalss(item.ud_label)]"
|
||||
v-if="
|
||||
item.ud_label == 1 || item.ud_label == 2 || item.ud_label == 3
|
||||
"
|
||||
>{{ labelList[item.ud_label] }}</text
|
||||
>
|
||||
<text class="item-address">{{ item.ud_marker }}</text>
|
||||
<text class="item-detailed-address">{{ item.ud_street_no }}</text>
|
||||
</view>
|
||||
<view class="item-role-info">
|
||||
<text class="item-name">{{ item.ud_name }}</text>
|
||||
<text class="item-sex">{{ item.sex == 0 ? "先生" : "女士" }}</text>
|
||||
<text class="item-mobile">{{ item.ud_mobile }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view
|
||||
class="tips"
|
||||
@click="handerList"
|
||||
v-if="formatAddreesList.length > 4"
|
||||
>
|
||||
{{ showFormatAddreesList ? "收起全部地址" : "展开更多地址" }}
|
||||
<text
|
||||
:class="[
|
||||
'iconfontAili ',
|
||||
showFormatAddreesList ? 'icon-top' : 'icon-xiala',
|
||||
]"
|
||||
></text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="list-block">
|
||||
<view class="list-title-block">
|
||||
<text class="iconfontAili icon-dingwei1"></text>
|
||||
<text class="title-block">附近地址</text>
|
||||
</view>
|
||||
<view
|
||||
class="list-item"
|
||||
v-for="(item, index) of nearbyAddressList"
|
||||
:key="index"
|
||||
>
|
||||
<view class="item-info" @click="handerSetAddress(item)">
|
||||
<text class="item-address">{{ item.name }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<uMask :show="showMask" :zIndex="2" @click="showMask = false"></uMask>
|
||||
</scroll-view>
|
||||
<scroll-view
|
||||
v-if="showSearchAddress && searchAddress.length > 0"
|
||||
class="uni-swiper-list"
|
||||
scroll-y
|
||||
@scroll="onScroll"
|
||||
scroll-with-animation="true"
|
||||
:scroll-top="scrollTop"
|
||||
>
|
||||
<view class="search-address-list">
|
||||
<view
|
||||
class="search-address-item"
|
||||
v-for="(item, index) of searchAddress"
|
||||
:key="index"
|
||||
>
|
||||
<view
|
||||
class="search-address-item-left"
|
||||
@click="handerSetAddress(item)"
|
||||
>
|
||||
<view class="item-left-name" v-html="item.searchName"></view>
|
||||
<view class="item-left-address">{{
|
||||
item.detailedInformation
|
||||
}}</view>
|
||||
</view>
|
||||
<view class="search-address-item-right">{{ item.distance }}km</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
<view class="u-btn u-btn-default" @click="AddAddress">
|
||||
<text class="iconfontAili icon-zengjiatianjiajiahao"></text>
|
||||
<text>新增收货地址</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
|
||||
<script>
|
||||
import uMask from "./umask.vue";
|
||||
import BMapLib from "../helpers/GeoUtils.js";
|
||||
import { mapState, mapMutations } from "vuex";
|
||||
|
||||
var bmap = require("../libs/bmap-wx.js");
|
||||
export default {
|
||||
components: {
|
||||
uMask,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
scrollTop: 0,
|
||||
showMask: false,
|
||||
originalData: {
|
||||
result: {
|
||||
addressComponent: {
|
||||
city: "正在定位",
|
||||
},
|
||||
sematic_description: "定位中..",
|
||||
},
|
||||
},
|
||||
addressList: [],
|
||||
formatAddreesList: [],
|
||||
showFormatAddreesList: false,
|
||||
nearbyAddressList: [],
|
||||
showSearchAddress: false,
|
||||
time: 0,
|
||||
searchAddress: [],
|
||||
labelList: ["", "家", "公司", "学校"],
|
||||
};
|
||||
},
|
||||
computed: mapState([
|
||||
"Config",
|
||||
"StateCode",
|
||||
"notice",
|
||||
"plantformInfo",
|
||||
"shopInfo",
|
||||
"userInfo",
|
||||
"hasLogin",
|
||||
]),
|
||||
onLoad(options) {
|
||||
console.log("options", options);
|
||||
},
|
||||
onShow() {
|
||||
if (this.userInfo.token) {
|
||||
this.getAddressList();
|
||||
}
|
||||
let city = uni.getStorageSync("city");
|
||||
if (!city) {
|
||||
this.isPhoneLocationEnabled();
|
||||
} else {
|
||||
this.originalData.result.addressComponent.city = city;
|
||||
}
|
||||
},
|
||||
onUnload() {
|
||||
uni.switchTab({
|
||||
url: `/pages/index/index`,
|
||||
});
|
||||
uni.removeStorageSync("city");
|
||||
},
|
||||
methods: {
|
||||
lableCalss(number) {
|
||||
if (number == 1) {
|
||||
return "item-lable-1";
|
||||
}
|
||||
|
||||
if (number == 2) {
|
||||
return "item-lable-2";
|
||||
}
|
||||
|
||||
if (number == 3) {
|
||||
return "item-lable-3";
|
||||
}
|
||||
},
|
||||
getAddressList() {
|
||||
console.log();
|
||||
|
||||
let that = this;
|
||||
that.$.request({
|
||||
url: that.Config.URL.user.address_lists,
|
||||
data: {},
|
||||
success: function (data, status, msg, code) {
|
||||
if (200 == status) {
|
||||
if (data.items.length > 0) {
|
||||
console.log(that.addressList);
|
||||
that.addressList = data.items;
|
||||
that.formatAddreesList = that.addressList.slice(0, 4);
|
||||
} else {
|
||||
that.setData({
|
||||
isdata: false,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
uni.stopPullDownRefresh();
|
||||
},
|
||||
});
|
||||
},
|
||||
AddAddress() {
|
||||
uni.navigateTo({
|
||||
url: "/member/address/manage",
|
||||
});
|
||||
},
|
||||
handerSetAddress(item, type) {
|
||||
if (type == "my") {
|
||||
let group = {
|
||||
name: item.ud_marker,
|
||||
location: {
|
||||
lat: item.ud_latitude,
|
||||
lng: item.ud_longitude,
|
||||
},
|
||||
};
|
||||
uni.setStorageSync("currentAddress", group);
|
||||
} else {
|
||||
uni.setStorageSync("currentAddress", item);
|
||||
}
|
||||
|
||||
uni.switchTab({
|
||||
url: "/pages/index/index",
|
||||
});
|
||||
},
|
||||
anewLoction() {
|
||||
uni.removeStorageSync("currentAddress");
|
||||
uni.switchTab({
|
||||
url: "/pages/index/index",
|
||||
});
|
||||
},
|
||||
isPhoneLocationEnabled() {
|
||||
let _this = this;
|
||||
// 获取用户手机系统信息
|
||||
uni.getSystemInfo({
|
||||
success: (res) => {
|
||||
const locationEnabled = res.locationEnabled;
|
||||
if (locationEnabled) {
|
||||
// 手机GPS定位已开启则判断微信APP是否已获取访问定位信息的权限
|
||||
_this.isAppAuthorized();
|
||||
} else {
|
||||
// 手机GPS定位未开启则引导用户手动前往开启
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content:
|
||||
'小程序需要基于您的手机定位信息为您提供服务,当前检测到您的手机并未打开定位开关,请关闭小程序后前往 "设置 - 定位服务/位置信息" 开启手机定位,然后重新进入小程序~',
|
||||
showCancel: false,
|
||||
confirmText: "我已知悉",
|
||||
});
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log("用户手机系统信息获取失败", err);
|
||||
},
|
||||
});
|
||||
},
|
||||
isAuthorized(a = "scope.userLocation") {
|
||||
// 检查当前是否已经授权访问scope属性
|
||||
let _this = this;
|
||||
uni.getSetting({
|
||||
success: (res) => {
|
||||
let userLocation = res.authSetting[a];
|
||||
if (!userLocation) {
|
||||
// 判断当前是否获得授权,如果没有就去申请授权
|
||||
_this.getAuthorize();
|
||||
} else {
|
||||
_this.getLocation();
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
_this.openSetting();
|
||||
},
|
||||
});
|
||||
},
|
||||
isAppAuthorized() {
|
||||
let _this = this;
|
||||
// 微信APP授权设置
|
||||
const appAuthorizeSetting = uni.getAppAuthorizeSetting();
|
||||
// 是否允许微信使用定位信息的开关
|
||||
let locationAuthorized = appAuthorizeSetting.locationAuthorized;
|
||||
switch (locationAuthorized) {
|
||||
case "authorized":
|
||||
_this.isAuthorized();
|
||||
break;
|
||||
case "denied":
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content:
|
||||
"已拒绝微信获取定位权限,即将打开权限管理页面,请把定位权限设置为允许~",
|
||||
confirmText: "前往设置",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
_this.openAppAuthorizeSetting();
|
||||
} else if (res.cancel) {
|
||||
_this.rejectGetLocation();
|
||||
}
|
||||
},
|
||||
});
|
||||
break;
|
||||
case "not determined":
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "请授权微信获取定位权限~",
|
||||
confirmText: "同意授权",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
_this.openAppAuthorizeSetting();
|
||||
} else if (res.cancel) {
|
||||
_this.rejectGetLocation();
|
||||
}
|
||||
},
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
getAuthorize(a = "scope.userLocation") {
|
||||
let _this = this;
|
||||
// uniapp弹窗弹出获取授权(地理,个人微信信息等授权信息)弹窗
|
||||
uni.authorize({
|
||||
scope: a,
|
||||
success: () => {
|
||||
_this.getLocation();
|
||||
},
|
||||
fail: () => {
|
||||
_this.openSetting();
|
||||
},
|
||||
});
|
||||
},
|
||||
openSetting() {
|
||||
let _this = this;
|
||||
uni.showModal({
|
||||
title: "提示",
|
||||
content: "我们需要获取您的位置信息,为您提供服务~",
|
||||
success: (res) => {
|
||||
if (res.confirm) {
|
||||
uni.openSetting({
|
||||
success: (res) => {
|
||||
if (res.authSetting["scope.userLocation"] === true) {
|
||||
_this.getLocation();
|
||||
} else {
|
||||
_this.rejectGetLocation();
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log("小程序授权弹窗打开失败", err);
|
||||
},
|
||||
});
|
||||
} else if (res.cancel) {
|
||||
_this.rejectGetLocation();
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
rejectGetLocation() {
|
||||
uni.showToast({
|
||||
title: "您拒绝了位置授权,小程序无法继续提供出行服务~",
|
||||
icon: "none",
|
||||
duration: 3000,
|
||||
});
|
||||
},
|
||||
openAppAuthorizeSetting() {
|
||||
let _this = this;
|
||||
uni.openAppAuthorizeSetting({
|
||||
success: (res) => {
|
||||
console.log("打开系统微信授权管理页成功", res);
|
||||
_this.isAuthorized();
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log("打开系统微信授权管理页失败", err);
|
||||
},
|
||||
});
|
||||
},
|
||||
getLocation() {
|
||||
var that = this;
|
||||
|
||||
let location = "";
|
||||
let currentAddress = uni.getStorageSync("currentAddress");
|
||||
if (currentAddress) {
|
||||
if (currentAddress.point) {
|
||||
location = currentAddress.point.y + "," + currentAddress.point.x;
|
||||
} else {
|
||||
location =
|
||||
currentAddress.location.lat + "," + currentAddress.location.lng;
|
||||
}
|
||||
let BMap = new bmap.BMapWX({
|
||||
ak: "LkqqCMB1qZmjYEkzx0Y1PTfmAUrkWPog",
|
||||
});
|
||||
let fail = function (res) {
|
||||
console.log("fail", res);
|
||||
};
|
||||
let success = function (res) {
|
||||
console.log("结果地址", res);
|
||||
that.originalData = res.originalData;
|
||||
that.originalData.result.sematic_description = currentAddress.name;
|
||||
let city = uni.getStorageSync("city");
|
||||
if (city) {
|
||||
that.originalData.result.addressComponent.city = city;
|
||||
}
|
||||
that.nearbyAddressList = res.originalData.result.pois;
|
||||
};
|
||||
BMap.regeocoding({
|
||||
location: location,
|
||||
coordtype: "gcj02ll",
|
||||
ret_coordtype: "gcj02ll",
|
||||
fail: fail,
|
||||
success: success,
|
||||
});
|
||||
} else {
|
||||
uni.getLocation({
|
||||
type: "wgs84",
|
||||
isHighAccuracy: true,
|
||||
success: function (res) {
|
||||
location = res.latitude + "," + res.longitude;
|
||||
|
||||
let BMap = new bmap.BMapWX({
|
||||
ak: "LkqqCMB1qZmjYEkzx0Y1PTfmAUrkWPog",
|
||||
});
|
||||
|
||||
let fail = function (res) {
|
||||
console.log("fail", res);
|
||||
};
|
||||
|
||||
let success = function (res) {
|
||||
console.log("结果地址", res);
|
||||
that.address = res.originalData.result.sematic_description;
|
||||
that.originalData = res.originalData;
|
||||
|
||||
let city = uni.getStorageSync("city");
|
||||
if (city) {
|
||||
that.originalData.result.addressComponent.city = city;
|
||||
}
|
||||
that.nearbyAddressList = res.originalData.result.pois;
|
||||
};
|
||||
|
||||
BMap.regeocoding({
|
||||
location: location,
|
||||
coordtype: "wgs84ll",
|
||||
ret_coordtype: "gcj02ll",
|
||||
fail: fail,
|
||||
success: success,
|
||||
});
|
||||
},
|
||||
fail: function (error) {
|
||||
console.error("获取位置失败:", error);
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
handerSkip() {
|
||||
uni.navigateTo({
|
||||
url: `/address/selectCity`,
|
||||
});
|
||||
},
|
||||
onSearch() {
|
||||
this.showMask = true;
|
||||
},
|
||||
handerList() {
|
||||
this.showFormatAddreesList = !this.showFormatAddreesList;
|
||||
if (this.showFormatAddreesList) {
|
||||
this.formatAddreesList = this.addressList;
|
||||
} else {
|
||||
this.formatAddreesList = this.addressList.slice(0, 4);
|
||||
}
|
||||
},
|
||||
onScroll() {},
|
||||
// 搜索地址
|
||||
handerAddress(e) {
|
||||
let that = this;
|
||||
|
||||
let value = e.target.value;
|
||||
if (value.length == 0) {
|
||||
this.showSearchAddress = false;
|
||||
} else {
|
||||
this.showSearchAddress = true;
|
||||
}
|
||||
|
||||
var fail = function (res) {
|
||||
console.log("fail", res);
|
||||
};
|
||||
|
||||
var currentPoint = {
|
||||
lat: that.originalData.result.location.lat,
|
||||
lng: that.originalData.result.location.lng,
|
||||
};
|
||||
|
||||
var metersToKilometers = function (meters) {
|
||||
let kilometers = meters / 1000;
|
||||
|
||||
// 保留两位小数
|
||||
return kilometers.toFixed(2);
|
||||
};
|
||||
|
||||
var success = function (res) {
|
||||
console.log("结果地址", res);
|
||||
if (res.data.status != 0) {
|
||||
uni.showToast({
|
||||
title: res.message,
|
||||
icon: "none",
|
||||
duration: 3000,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
that.searchAddress = res.data.result
|
||||
.filter((item) => "location" in item)
|
||||
.map((item) => {
|
||||
let obj = {
|
||||
...item,
|
||||
name: item.name,
|
||||
detailedInformation: item.address.replace(/-/g, ""),
|
||||
distance: metersToKilometers(
|
||||
BMapLib.GeoUtils.getDistance(currentPoint, item.location)
|
||||
),
|
||||
};
|
||||
return obj;
|
||||
});
|
||||
|
||||
console.log("that.searchAddress", that.searchAddress);
|
||||
|
||||
that.searchAddress.forEach((item) => {
|
||||
if (item.name.indexOf(value) >= 0) {
|
||||
item.searchName = item.name.replaceAll(
|
||||
value,
|
||||
"<font style='color:#ee852f;padding:0 4px'>" + value + "</font>"
|
||||
);
|
||||
} else {
|
||||
item.searchName = item.name;
|
||||
}
|
||||
});
|
||||
console.log("searchAddress", that.searchAddress);
|
||||
};
|
||||
|
||||
let params = {
|
||||
query: value,
|
||||
region: this.originalData.result.addressComponent.city,
|
||||
output: "json",
|
||||
city_limit: true,
|
||||
ak: "vMqiMPVK8i30Q5VOCDI3LWxgZqR2tfKa",
|
||||
ret_coordtype: "gcj02ll",
|
||||
};
|
||||
|
||||
let city = that.originalData.result.addressComponent.city;
|
||||
if (city) {
|
||||
params.center = "";
|
||||
}
|
||||
|
||||
if (this.time !== null) {
|
||||
clearTimeout(this.time);
|
||||
}
|
||||
|
||||
this.time = setTimeout(() => {
|
||||
uni.request({
|
||||
url: `https://api.map.baidu.com/place/v2/suggestion`,
|
||||
data: params,
|
||||
success: success,
|
||||
fail: fail,
|
||||
});
|
||||
}, 600);
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
.address-container {
|
||||
height: calc(100vh - 88rpx);
|
||||
background: #fff;
|
||||
overflow: hidden;
|
||||
|
||||
.item-lable-1 {
|
||||
background: #fdf3da;
|
||||
color: #de8a48;
|
||||
}
|
||||
|
||||
.item-lable-2 {
|
||||
background: #e5eefb;
|
||||
color: #4687e4;
|
||||
}
|
||||
|
||||
.item-lable-3 {
|
||||
background: #eff9e7;
|
||||
color: #6eb768;
|
||||
}
|
||||
|
||||
.hander {
|
||||
.uni-navbar__header {
|
||||
align-items: center;
|
||||
padding: 10rpx 20rpx !important;
|
||||
}
|
||||
|
||||
.left-block {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
line-height: 60rpx;
|
||||
}
|
||||
.city-block {
|
||||
white-space: nowrap; /* 确保文本在一行内显示 */
|
||||
overflow: hidden; /* 隐藏超出容器的文本 */
|
||||
text-overflow: ellipsis; /* 使用省略符号表示文本超出 */
|
||||
max-width: 140rpx;
|
||||
padding-right: 4rpx;
|
||||
}
|
||||
|
||||
.icon-dingwei {
|
||||
font-size: 40rpx;
|
||||
}
|
||||
|
||||
.icon-right {
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.address-block {
|
||||
margin: 20rpx 0;
|
||||
padding: 20rpx 32rpx;
|
||||
border-top: 2rpx solid #f0f0f0;
|
||||
border-bottom: 2rpx solid #f0f0f0;
|
||||
|
||||
.address-box {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
.address-left-block {
|
||||
font-size: 32rpx;
|
||||
white-space: nowrap; /* 确保文本在一行内显示 */
|
||||
overflow: hidden; /* 隐藏超出容器的文本 */
|
||||
text-overflow: ellipsis; /* 使用省略符号表示文本超出 */
|
||||
max-width: 520rpx;
|
||||
}
|
||||
|
||||
.address-right-block {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #de8a48;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.list-block {
|
||||
padding: 0 32rpx;
|
||||
border-bottom: 2rpx solid #f8f8f8;
|
||||
|
||||
.list-title-block {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
padding: 12rpx 0;
|
||||
background: #fff;
|
||||
|
||||
.title-block {
|
||||
font-size: 28rpx;
|
||||
padding-left: 6rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.list-item {
|
||||
margin: 0 32rpx;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 2rpx solid #f0f0f0;
|
||||
|
||||
.item-lable {
|
||||
display: inline-block;
|
||||
margin-right: 9px;
|
||||
padding: 0px 8px;
|
||||
width: 32px;
|
||||
border-radius: 4px;
|
||||
text-align: center;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.item-address {
|
||||
margin-right: 8rpx;
|
||||
font-weight: 700;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.item-detailed-address {
|
||||
font-weight: 700;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.item-role-info {
|
||||
color: #848484;
|
||||
font-size: 24rpx;
|
||||
|
||||
.item-name {
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
|
||||
.item-mobile {
|
||||
margin-left: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.tips {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 20rpx 32rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
}
|
||||
|
||||
.icon-zengjiatianjiajiahao {
|
||||
font-size: 40rpx;
|
||||
color: #3579ff;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
|
||||
.search-address-list {
|
||||
margin: 40rpx;
|
||||
|
||||
.search-address-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 2rpx solid #f0f0f0;
|
||||
|
||||
.search-address-item-left {
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.search-address-item-right {
|
||||
color: #d7d7d7;
|
||||
width: 20%;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
rich-text {
|
||||
// max-width: 90%;
|
||||
max-height: 27px;
|
||||
overflow: hidden;
|
||||
word-break: break-all; /* break-all(允许在单词内换行。) */
|
||||
text-overflow: ellipsis; /* 超出部分省略号 */
|
||||
display: -webkit-box; /** 对象作为伸缩盒子模型显示 **/
|
||||
-webkit-box-orient: vertical; /** 设置或检索伸缩盒对象的子元素的排列方式 **/
|
||||
-webkit-line-clamp: 2; /** 显示的行数 **/
|
||||
}
|
||||
|
||||
// .item-left-name rich-text {
|
||||
// white-space: nowrap; /* 确保文本在一行内显示 */
|
||||
// overflow: hidden; /* 隐藏超出容器的文本 */
|
||||
// text-overflow: ellipsis; /* 使用省略符号表示文本超出 */
|
||||
// -webkit-box-orient: vertical;
|
||||
// max-width: 90%;
|
||||
// display: -webkit-box;
|
||||
// box-sizing: border-box;
|
||||
// }
|
||||
|
||||
.item-left-address {
|
||||
font-size: 24rpx;
|
||||
color: #848484;
|
||||
white-space: nowrap; /* 确保文本在一行内显示 */
|
||||
overflow: hidden; /* 隐藏超出容器的文本 */
|
||||
text-overflow: ellipsis; /* 使用省略符号表示文本超出 */
|
||||
max-width: 90%;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.input-view {
|
||||
width: 92%;
|
||||
display: flex;
|
||||
background-color: #f5f5f5;
|
||||
height: 60rpx;
|
||||
border-radius: 30rpx;
|
||||
padding: 0 4%;
|
||||
flex-wrap: nowrap;
|
||||
margin: 10rpx 0;
|
||||
line-height: 60rpx;
|
||||
margin-left: 10rpx;
|
||||
color: #b9b9b9;
|
||||
}
|
||||
|
||||
.input-view .uni-icon {
|
||||
line-height: 60rpx !important;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.input-view .uni-icons {
|
||||
font-size: 32rpx !important;
|
||||
}
|
||||
|
||||
.input-view .input {
|
||||
height: 60rpx;
|
||||
line-height: 60rpx;
|
||||
width: 94%;
|
||||
padding: 0 2%;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
|
||||
.uni-swiper-list {
|
||||
height: calc(100vh - 98px);
|
||||
}
|
||||
|
||||
.u-btn-default {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
color: #000;
|
||||
z-index: 1;
|
||||
margin: 0;
|
||||
height: 120rpx;
|
||||
line-height: 120rpx;
|
||||
bottom: constant(safe-area-inset-bottom);
|
||||
// bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
}
|
||||
</style>.
|
||||
@ -1,130 +0,0 @@
|
||||
<template>
|
||||
<view
|
||||
class="u-mask"
|
||||
hover-stop-propagation
|
||||
:style="[maskStyle, zoomStyle]"
|
||||
@tap="click"
|
||||
@touchmove.stop.prevent="() => {}"
|
||||
:class="{
|
||||
'u-mask-zoom': zoom,
|
||||
'u-mask-show': show,
|
||||
}"
|
||||
>
|
||||
<slot />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* mask 遮罩
|
||||
* @description 创建一个遮罩层,用于强调特定的页面元素,并阻止用户对遮罩下层的内容进行操作,一般用于弹窗场景
|
||||
* @tutorial https://www.uviewui.com/components/mask.html
|
||||
* @property {Boolean} show 是否显示遮罩(默认false)
|
||||
* @property {String Number} z-index z-index 层级(默认1070)
|
||||
* @property {Object} custom-style 自定义样式对象,见上方说明
|
||||
* @property {String Number} duration 动画时长,单位毫秒(默认300)
|
||||
* @property {Boolean} zoom 是否使用scale对遮罩进行缩放(默认true)
|
||||
* @property {Boolean} mask-click-able 遮罩是否可点击,为false时点击不会发送click事件(默认true)
|
||||
* @event {Function} click mask-click-able为true时,点击遮罩发送此事件
|
||||
* @example <u-mask :show="show" @click="show = false"></u-mask>
|
||||
*/
|
||||
export default {
|
||||
name: "u-mask",
|
||||
props: {
|
||||
// 是否显示遮罩
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 层级z-index
|
||||
zIndex: {
|
||||
type: [Number, String],
|
||||
default: "",
|
||||
},
|
||||
// 用户自定义样式
|
||||
customStyle: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
},
|
||||
},
|
||||
// 遮罩的动画样式, 是否使用使用zoom进行scale进行缩放
|
||||
zoom: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
// 遮罩的过渡时间,单位为ms
|
||||
duration: {
|
||||
type: [Number, String],
|
||||
default: 300,
|
||||
},
|
||||
// 是否可以通过点击遮罩进行关闭
|
||||
maskClickAble: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
zoomStyle: {
|
||||
transform: "",
|
||||
},
|
||||
scale: "scale(1.2, 1.2)",
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
show(n) {
|
||||
if (n && this.zoom) {
|
||||
// 当展示遮罩的时候,设置scale为1,达到缩小(原来为1.2)的效果
|
||||
this.zoomStyle.transform = "scale(1, 1)";
|
||||
} else if (!n && this.zoom) {
|
||||
// 当隐藏遮罩的时候,设置scale为1.2,达到放大(因为显示遮罩时已重置为1)的效果
|
||||
this.zoomStyle.transform = this.scale;
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
maskStyle() {
|
||||
let style = {};
|
||||
style.backgroundColor = "rgba(0, 0, 0, 0.6)";
|
||||
if (this.show)
|
||||
style.zIndex = this.zIndex ? this.zIndex : this.$u.zIndex.mask;
|
||||
else style.zIndex = -1;
|
||||
style.transition = `all ${this.duration / 1000}s ease-in-out`;
|
||||
// 判断用户传递的对象是否为空,不为空就进行合并
|
||||
if (Object.keys(this.customStyle).length)
|
||||
style = {
|
||||
...style,
|
||||
...this.customStyle,
|
||||
};
|
||||
return style;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
click() {
|
||||
if (!this.maskClickAble) return;
|
||||
this.$emit("click");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.u-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
opacity: 0;
|
||||
transition: transform 0.3s;
|
||||
}
|
||||
|
||||
.u-mask-show {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.u-mask-zoom {
|
||||
transform: scale(1.2, 1.2);
|
||||
}
|
||||
</style>
|
||||
369
components/bw-swiper/bw-swiper.vue
Normal file
@ -0,0 +1,369 @@
|
||||
<template>
|
||||
<view class="swiperContent">
|
||||
<swiper
|
||||
@change="change"
|
||||
@animationfinish="animationfinish"
|
||||
:indicator-dots="indicatorDots"
|
||||
:indicator-active-color="indicatorActiveColor"
|
||||
:indicator-color="indicatorColor"
|
||||
:current="current"
|
||||
:interval="interval"
|
||||
:duration="duration"
|
||||
:circular="circular"
|
||||
:vertical="vertical"
|
||||
:previous-margin="previousMargin"
|
||||
:next-margin="nextMargin"
|
||||
:display-multiple-items="displayMultipleItems"
|
||||
:skip-hidden-item-layout="skipHiddenItemLayout"
|
||||
:autoplay="(autoplay && flag)"
|
||||
:style="{'height':swiperHeight+'px'}"
|
||||
:class="(swiperType && displayMultipleItems ==1 && !vertical && !fullScreen)?'cardSwiper':'' "
|
||||
class="screen-swiper"
|
||||
>
|
||||
<swiper-item class="swiper-item" v-for="(item,index) in swiperList" :key="index" :class="(cardCur==index && displayMultipleItems ==1 && !vertical && !fullScreen)?'cur':''" @tap="tplGoToPage" :data-id="(item.did)" :data-name="(item.name)" :data-type="(item.selectType)" :data-keyword="(item.keyWord)" :data-appid="(item.AppId)" :data-appurl="(item.AppUrl)" :data-MinAppUrl="(item.MinAppUrl)">
|
||||
<view v-if="item[imageKey] && !item[videoKey]">
|
||||
<image :src="item[imageKey]" :style="{'height':swiperHeight+'px'}"></image>
|
||||
<text v-if="textTip" class="swiperText" :style="{
|
||||
'bottom':(swiperType?(textStyleBottom+12):textStyleBottom)+'%',
|
||||
'right':textStyleRight+'%',
|
||||
'color':textStyleColor,
|
||||
'background':textStyleBgcolor,
|
||||
'font-size':rpxtopx(textStyleSize)
|
||||
}">{{item[textKey]}}</text>
|
||||
</view>
|
||||
<view v-if="item[videoKey]">
|
||||
<video :src="item[videoKey]" @play="play" @pause="pause" :style="{'height':swiperHeight+'px'}" autoplay loop muted :autoplay="videoAutoplay" objectFit="cover"></video>
|
||||
</view>
|
||||
</swiper-item>
|
||||
<swiper-item class="swiper-item" v-if="swiperList.length==0" >
|
||||
<text></text>
|
||||
</swiper-item>
|
||||
</swiper>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name:'bw-swiper',
|
||||
created:function(){
|
||||
var that = this;
|
||||
if(this.fullScreen){
|
||||
uni.getSystemInfo({
|
||||
success:function(e){
|
||||
that.swiperHeight = e.screenHeight -44
|
||||
}})
|
||||
}
|
||||
},
|
||||
mounted:function(){
|
||||
if(!this.fullScreen){
|
||||
const query = uni.createSelectorQuery().in(this);
|
||||
query.select('.swiper-item').boundingClientRect(data => {
|
||||
if(!!data){
|
||||
this.swiperHeight = data.width/this.w_h;
|
||||
}
|
||||
}).exec();
|
||||
}
|
||||
},
|
||||
props: {
|
||||
fullScreen:{ // 是否全屏
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
swiperList:{ // 滑块视图容器数据
|
||||
type:Array,
|
||||
required: true,
|
||||
default:function(){
|
||||
return []
|
||||
}
|
||||
},
|
||||
swiperType:{ // false => 全屏限高轮播图 true => 卡塔式轮播图
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
videoAutoplay:{ // true =>自动播放
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
videoKey:{ // 视频映射的键
|
||||
type:String,
|
||||
default:'src'
|
||||
},
|
||||
imageKey:{ // 图片映射的键
|
||||
type:String,
|
||||
default:'img'
|
||||
},
|
||||
textKey:{ // 文字说明映射的键
|
||||
type:String,
|
||||
default:'text'
|
||||
},
|
||||
textTip:{ // 图片文字说明 false => 隐藏
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
textStyleSize:{ // 图片文字大小
|
||||
type:Number,
|
||||
default:24
|
||||
},
|
||||
textStyleBottom:{ // 图片文字位置
|
||||
type:Number,
|
||||
default:5
|
||||
},
|
||||
textStyleRight:{ // 图片文字位置
|
||||
type:Number,
|
||||
default:5
|
||||
},
|
||||
textStyleColor:{ // 图片文字颜色
|
||||
type:String,
|
||||
default:'#ffffff'
|
||||
},
|
||||
textStyleBgcolor:{ // 图片文字背景色
|
||||
type:String,
|
||||
default:'transparent'
|
||||
},
|
||||
w_h:{ //宽高比 推荐 w/h => 2
|
||||
type:Number,
|
||||
default:2
|
||||
},
|
||||
skipHiddenItemLayout:{ //是否跳过未显示的滑块布局,设为 true 可优化复杂情况下的滑动性能,但会丢失隐藏状态滑块的布局信息
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
displayMultipleItems:{ //同时显示的滑块数量
|
||||
type:Number,
|
||||
default:1
|
||||
},
|
||||
nextMargin:{ // 后边距,可用于露出后一项的一小部分,接受 px 和 rpx 值 头条小程序不支持
|
||||
type:String,
|
||||
default:'0px'
|
||||
},
|
||||
previousMargin:{//前边距,可用于露出前一项的一小部分,接受 px 和 rpx 值头条小程序不支持
|
||||
type:String,
|
||||
default:'0px'
|
||||
},
|
||||
vertical:{ //滑动方向是否为纵向 卡牌 不支持纵向以及同时显示的2块以上滑块数量
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
circular:{ // 是否采用衔接滑动
|
||||
type:Boolean,
|
||||
default:true
|
||||
},
|
||||
duration:{ // 滑动动画时长
|
||||
type:Number,
|
||||
default:400
|
||||
},
|
||||
interval:{ // 自动切换时间间隔
|
||||
type:Number,
|
||||
default:2500
|
||||
},
|
||||
current:{ // 当前所在滑块的 index
|
||||
type:Number,
|
||||
default:0
|
||||
},
|
||||
autoplay:{ // 是否自动切换
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
indicatorColor:{ // 指示点颜色
|
||||
type:String,
|
||||
default:'#CCCCCC'
|
||||
},
|
||||
indicatorActiveColor: { // 当前选中的指示点颜色
|
||||
type: String,
|
||||
default: '#ffffff'
|
||||
},
|
||||
indicatorDots: { // 是否显示面板指示点
|
||||
type: Boolean,
|
||||
default: true
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
flag:true,
|
||||
cardCur:0,
|
||||
swiperHeight:300
|
||||
}
|
||||
},
|
||||
computed:{
|
||||
|
||||
},
|
||||
methods: {
|
||||
rpxtopx:function(size){
|
||||
// #ifdef MP-WEIXIN
|
||||
return uni.upx2px(size)+'px'
|
||||
// #endif
|
||||
// #ifndef MP-WEIXIN
|
||||
return size+'rpx';
|
||||
// #endif
|
||||
},
|
||||
play:function(){
|
||||
this.flag = false
|
||||
},
|
||||
pause:function(){
|
||||
this.flag = true
|
||||
},
|
||||
|
||||
tplGoToPage: function(e) {
|
||||
let that = this;
|
||||
var t = e.currentTarget.dataset;
|
||||
switch (parseInt(t.type)) {
|
||||
case 1:
|
||||
that.$.gopage("/pages/product/detail?pid=" + t.id);
|
||||
break;
|
||||
case 2:
|
||||
that.$.gopage("/pages/product/list?category_id=" + (t.id || 0) + "&cname=" + t.name);
|
||||
break;
|
||||
case 3:
|
||||
that.$.gopage("/pages/product/list?pname=" + t.keyword);
|
||||
break;
|
||||
case 4: //快捷入口
|
||||
if (t.appurl.indexOf("article-list") >= 0) {
|
||||
that.$.gopage('/pagesub/article/list');
|
||||
} else if (t.appurl.indexOf("fightgroupsorderlist") >= 0) {
|
||||
that.$.gopage('/activity/fightgroup/order');
|
||||
} else if (t.appurl.indexOf("fightgroupslist/fightgroupslist") >= 0) {
|
||||
that.$.gopage('/activity/fightgroup/list');
|
||||
} else if (t.appurl.indexOf("bargainlist/bargainlist") >= 0) {
|
||||
that.$.gopage('/activity/cutprice/list');
|
||||
} else if (t.appurl.indexOf("receivecontent/receivecontent") >= 0) {
|
||||
that.$.gopage('/activity/coupon/list');
|
||||
} else if (t.appurl.indexOf("cashaccount/cashaccount") >= 0) {
|
||||
that.$.gopage('/member/cash/predeposit');
|
||||
} else if (t.appurl.indexOf("fanslist/fanslist") >= 0) {
|
||||
that.$.gopage('/member/fans/list');
|
||||
} else if (t.appurl.indexOf("nearbylist/nearbylist") >= 0) {
|
||||
that.$.gopage('/chain/chain/list');
|
||||
} else if (t.appurl.indexOf("kind_id=1202") >= 0) {
|
||||
that.$.gopage('/member/order/list?kind_id=1202');
|
||||
} else if (t.appurl.indexOf("endorsement/endorsement") >= 0) {
|
||||
that.$.gopage('/member/fans/endorsement');
|
||||
} else if (t.appurl.indexOf("?type=3&sl=3") >= 0) {
|
||||
that.$.gopage('/member/order/list?type=3&sl=3');
|
||||
} else if (t.appurl.indexOf("goodcollection/goodcollection") >= 0) {
|
||||
that.$.gopage('/member/member/favorites');
|
||||
} else if (t.appurl.indexOf("fansrank/fansrank") >= 0) {
|
||||
that.$.gopage('/member/fans/fansrank');
|
||||
} else if (t.appurl.indexOf("favorable/favorable") >= 0) {
|
||||
that.$.gopage('/chain/chain/favorable');
|
||||
} else if (t.appurl.indexOf("fanslist/fanslist") >= 0) {
|
||||
that.$.gopage('/member/fans/list');
|
||||
} else if (t.appurl.indexOf("scan/scan") >= 0) {
|
||||
that.$.gopage('/chain/chain/scan');
|
||||
} else if (t.appurl.indexOf("smashgoldeneggs/smashgoldeneggs") >= 0) {
|
||||
that.$.gopage('/activity/smashgoldeneggs/detail');
|
||||
} else if (t.appurl.indexOf("luckydraw/luckydraw") >= 0) {
|
||||
that.$.gopage('/member/luckydraw/detail');
|
||||
} else {
|
||||
that.$.gopage(t.appurl);
|
||||
}
|
||||
|
||||
break;
|
||||
case 5:
|
||||
if (t.appurl.indexOf("fanslist/fanslist") >= 0) {
|
||||
that.$.gopage('/member/fans/list');
|
||||
} else {
|
||||
that.$.gopage("/pagesub/article/list?category_id=" + (t.id || 0));
|
||||
}
|
||||
//that.$.gopage(t.appurl);
|
||||
break;
|
||||
case 6:
|
||||
that.$.gopage("/pagesub/article/detail?id=" + t.id);
|
||||
//that.$.gopage(t.appurl);
|
||||
break;
|
||||
case 7:
|
||||
uni.navigateToMiniProgram({
|
||||
appId: t.appid,
|
||||
path: t.appurl || ""
|
||||
});
|
||||
break;
|
||||
case 8:
|
||||
that.$.gopage("/pagesub/diy-page/diy-page?id=" + t.id);
|
||||
break;
|
||||
case 9:
|
||||
that.$.gopage("/pagesub/webpage/webpage?u=" + encodeURIComponent(t.appurl) + "&tn=" + t.name + "&tc=" + t.appid + "&tb=" +
|
||||
t.keyword);
|
||||
break;
|
||||
case 99:
|
||||
that.$.gopage(
|
||||
'/pagesub/webpage/web?u=' +
|
||||
encodeURIComponent(t.appurl) +
|
||||
'&tn=' +
|
||||
t.name +
|
||||
'&tc=' +
|
||||
t.appid +
|
||||
'&tb=' +
|
||||
t.keyword
|
||||
);
|
||||
|
||||
case 10:
|
||||
that.$.gopage(t.appurl);
|
||||
break;
|
||||
case 11:
|
||||
that.$.gopage(t.appurl);
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
clickItem:function(index){
|
||||
if(this.swiperList.length>0){
|
||||
this.$emit('clickItem',this.swiperList[index])
|
||||
}
|
||||
},
|
||||
change:function(e){
|
||||
this.$emit('change',e)
|
||||
},
|
||||
animationfinish:function(e){
|
||||
this.cardCur = e.detail.current;
|
||||
this.$emit('animationfinish',e)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.cardSwiper .swiper-item{
|
||||
width:86%!important;
|
||||
overflow: initial;
|
||||
}
|
||||
.cardSwiper .swiper-item view{
|
||||
width: 100%;
|
||||
display: block;
|
||||
height: 100%;
|
||||
border-radius: 10rpx;
|
||||
transform: scale(0.9,0.8);
|
||||
opacity: 0.7;
|
||||
transition: all 0.1s ease-in 0s;
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
margin-left:8.1%;
|
||||
}
|
||||
.cardSwiper .cur view{
|
||||
transform: initial;
|
||||
opacity: 1;
|
||||
transition: all 0.1s ease-in 0s;
|
||||
}
|
||||
.swiper-item view{
|
||||
height:100%;
|
||||
width:100%;
|
||||
position: relative;
|
||||
}
|
||||
.swiperText{
|
||||
position: absolute;
|
||||
color:#ffffff;
|
||||
z-index:2;
|
||||
border-radius: 4rpx;
|
||||
padding:0 4rpx;
|
||||
}
|
||||
.screen-swiper image{
|
||||
width:100%;
|
||||
}
|
||||
.screen-swiper video,
|
||||
.swiper-item video {
|
||||
width: 100%;
|
||||
display: block;
|
||||
height: 100%;
|
||||
}
|
||||
.swiperContent{
|
||||
width:100%;
|
||||
}
|
||||
</style>
|
||||
267
components/cwx-keyboard/cwx-keyboard.vue
Normal file
@ -0,0 +1,267 @@
|
||||
<template>
|
||||
<view class='keyboard' @click.stop='_handleKeyPress'>
|
||||
<view class='key-row'>
|
||||
<view class='key-cell cell_b' data-num='7'>7</view>
|
||||
<view class='key-cell cell_b' data-num='8'>8</view>
|
||||
<view class='key-cell cell_b' data-num='9'>9</view>
|
||||
<view class='key-cell cell_b' data-num='-1'></view>
|
||||
</view>
|
||||
<view class='key-row'>
|
||||
<view class='key-cell cell_b' data-num='4'>4</view>
|
||||
<view class='key-cell cell_b' data-num='5'>5</view>
|
||||
<view class='key-cell cell_b' data-num='6'>6</view>
|
||||
<view class='key-cell cell_b' data-num='-1'></view>
|
||||
</view>
|
||||
<view class='key-row'>
|
||||
<view class='key-cell cell_b' data-num='1'>1</view>
|
||||
<view class='key-cell cell_b' data-num='2'>2</view>
|
||||
<view class='key-cell cell_b' data-num='3'>3</view>
|
||||
<view class='key-cell cell_b' data-num='-1'></view>
|
||||
</view>
|
||||
<view class="key-zero-and-point">
|
||||
<view class="a cell_b zero" data-num='0'>0</view>
|
||||
<view class="a cell_b point" data-num='.'>.</view>
|
||||
</view>
|
||||
|
||||
<view @touchstart="touchstart" @touchend="touchend" data-num='D' class="key-confirm2">
|
||||
<text data-num='D'>C</text>
|
||||
</view>
|
||||
|
||||
<view class='key-confirm' :style="{'background':btnColor}" data-num='S'>
|
||||
<view data-num='S' class="">
|
||||
<view data-num='S' class="title">{{title}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default{
|
||||
name:"keyBoard",
|
||||
props:{
|
||||
title:{
|
||||
default:'确认',
|
||||
type:String
|
||||
},
|
||||
btnColor:{
|
||||
default:'green',
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
money:'',
|
||||
Cdel:'',
|
||||
Time:''
|
||||
}
|
||||
},
|
||||
|
||||
watch:{
|
||||
money(val){
|
||||
this.$emit('update:money',val);
|
||||
|
||||
}
|
||||
},
|
||||
|
||||
methods : {
|
||||
touchstart(){
|
||||
this.Time=setInterval(()=>{
|
||||
//console.log(this.money);
|
||||
if(this.money==''){
|
||||
clearInterval();
|
||||
}
|
||||
this.money = this.money.substring(0,this.money.length - 1);
|
||||
},200)
|
||||
},
|
||||
touchend(){
|
||||
clearInterval(this.Time);
|
||||
},
|
||||
//处理按键
|
||||
_handleKeyPress(e) {
|
||||
// //console.log('点击传e',e.target.dataset.num);
|
||||
let num = e.target.dataset.num;
|
||||
//不同按键处理逻辑
|
||||
// -1 代表无效按键,直接返回
|
||||
if (num == -1) return false;
|
||||
switch (String(num)) {
|
||||
//小数点
|
||||
case '.':
|
||||
this._handleDecimalPoint();
|
||||
break;
|
||||
//删除键
|
||||
case 'D':
|
||||
this._handleDeleteKey();
|
||||
break;
|
||||
//清空键
|
||||
case 'C':
|
||||
this._handleClearKey();
|
||||
break;
|
||||
//确认键
|
||||
case 'S':
|
||||
this._handleConfirmKey();
|
||||
break;
|
||||
default:
|
||||
this._handleNumberKey(num);
|
||||
break;
|
||||
}
|
||||
},
|
||||
//处理小数点函数
|
||||
_handleDecimalPoint() {
|
||||
//如果包含小数点,直接返回
|
||||
if (this.money.indexOf('.') > -1) return false;
|
||||
//如果小数点是第一位,补0
|
||||
if (!this.money.length)
|
||||
this.money = '0.';
|
||||
//如果不是,添加一个小数点
|
||||
else
|
||||
this.money = this.money + '.';
|
||||
},
|
||||
//处理删除键
|
||||
_handleDeleteKey() {
|
||||
let S = this.money;
|
||||
//如果没有输入,直接返回
|
||||
if (!S.length) return false;
|
||||
//否则删除最后一个
|
||||
this.money = S.substring(0, S.length - 1);
|
||||
},
|
||||
|
||||
//处理清空键
|
||||
_handleClearKey() {
|
||||
this.money = '';
|
||||
},
|
||||
|
||||
//处理数字
|
||||
_handleNumberKey(num) {
|
||||
if(this.money.length==10){
|
||||
return
|
||||
}
|
||||
let S = this.money;
|
||||
//如果有小数点且小数点位数不小于2
|
||||
if ( S.indexOf('.') > -1 && S.substring(S.indexOf('.') + 1).length < 2)
|
||||
this.money = S + num;
|
||||
//没有小数点
|
||||
if (!(S.indexOf('.') > -1)) {
|
||||
//如果第一位是0,只能输入小数点
|
||||
if (num == 0 && S.length == 0)
|
||||
this.money = '0.';
|
||||
else {
|
||||
if (S.length && Number(S.charAt(0)) === 0) return;
|
||||
this.money = S + num;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//提交
|
||||
_handleConfirmKey() {
|
||||
let S = this.money;
|
||||
//未输入
|
||||
if (!S.length||S==0){
|
||||
uni.showToast({
|
||||
title: '请输入正确的数值',
|
||||
icon:'none',
|
||||
duration: 1000
|
||||
});
|
||||
return false;
|
||||
}
|
||||
//将 8. 这种转换成 8.00
|
||||
if (S.indexOf('.') > -1 && S.indexOf('.') == (S.length - 1))
|
||||
S = Number(S.substring(0, S.length - 1)).toFixed(2);
|
||||
//保留两位
|
||||
S = Number(S).toFixed(2);
|
||||
this.$emit('confirmEvent',S); //提交参数
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
.cell_b{
|
||||
border-right: 1px solid #d5d5d6;
|
||||
border-bottom: 1px solid #d5d5d6;
|
||||
}
|
||||
|
||||
.key-container {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.keyboard {
|
||||
flex: 1;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
height: 40vh;
|
||||
width: 100%;
|
||||
|
||||
background: #FFFFFF;
|
||||
}
|
||||
.keyboard .key-row {
|
||||
display: flex;
|
||||
display: -webkit-flex;
|
||||
position: relative;
|
||||
height: 10vh;
|
||||
line-height: 10vh;
|
||||
|
||||
|
||||
}
|
||||
|
||||
.keyboard .key-cell {
|
||||
flex: 1;
|
||||
-webkit-box-flex: 1;
|
||||
font-size: 60rpx;
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.keyboard .key-confirm {
|
||||
position: absolute;
|
||||
text-align: center;
|
||||
height: 30vh;
|
||||
width: 25%;
|
||||
line-height: 30vh;
|
||||
color: #FFFFFF;
|
||||
z-index: 5;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
|
||||
display:flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.keyboard .key-confirm2 {
|
||||
position: absolute;
|
||||
height: 10vh;
|
||||
width: 25%;
|
||||
line-height: 10vh;
|
||||
z-index: 9999;
|
||||
right: 0;
|
||||
top: 0;
|
||||
|
||||
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.key-zero-and-point{
|
||||
display: flex;height: 10vh;justify-content: center;align-items: center;width:75%;font-size: 60rpx;
|
||||
.zero{
|
||||
display: flex;justify-content: center;align-items: center;width: 66.66%;font-size: 60rpx;text-align: center;height: 100%;
|
||||
}
|
||||
.point{
|
||||
display: flex;justify-content: center;align-items: center;width: 33.33%;font-size: 60rpx;text-align: center;height: 100%;
|
||||
}
|
||||
}
|
||||
.key-cell:active{
|
||||
color: white;
|
||||
background: black; //黑色
|
||||
opacity: 0.1; //这里重要,就是通过这个透明度来设置
|
||||
}
|
||||
.a:active,.key-confirm2:active{
|
||||
color: white;
|
||||
background: black; //黑色
|
||||
opacity: 0.1; //这里重要,就是通过这个透明度来设置
|
||||
}
|
||||
</style>
|
||||
184
components/ss-select-city/citys.js
Normal file
@ -0,0 +1,184 @@
|
||||
const citys = [
|
||||
{
|
||||
"letter": "A",
|
||||
"list": [
|
||||
"安远","安义","安溪","安丘","安宁","安吉","安福","阿城","安阳","安顺","鞍山","安庆","安康","阿里",
|
||||
"阿勒泰","阿拉善盟","阿克苏","阿坝"
|
||||
]
|
||||
},
|
||||
{
|
||||
"letter": "B",
|
||||
"list": [
|
||||
"北京","博兴","博罗","博爱","璧山","宾阳","宾县","滨海","巴彦","宝应","亳州","博尔塔拉","滨州","毕节",
|
||||
"本溪","北海","巴中","巴音郭楞","巴彦淖尔","包头","保山","宝鸡","保定","蚌埠","白银","白山","百色","白城"
|
||||
]
|
||||
},
|
||||
{
|
||||
"letter": "C",
|
||||
"list": [
|
||||
"成都","常州","长沙","长春","重庆","朝阳","巢湖","长治","昌吉","昌都","常德","沧州","郴州","承德","潮州",
|
||||
"滁州","楚雄","崇左","池州","赤峰","枞阳","从化","慈溪","淳安","崇州","崇义","崇仁","茌平","成武","城口",
|
||||
"呈贡","潮安","昌邑","长兴","长汀","长泰","常熟","常山","昌乐","长乐","长海","长丰","长岛","曹县","苍山",
|
||||
"苍南"
|
||||
]
|
||||
},
|
||||
{
|
||||
"letter": "D",
|
||||
"list": [
|
||||
"丹东","大理","东莞","大连","大兴安岭","大同","大庆","德州","德阳","德宏","达州","大丰","东营","迪庆",
|
||||
"定西","单县","当涂","砀山","岱山","大邑","大田","大埔","丹阳","德化","德安","大足","大余","德庆","德清",
|
||||
"登封","德惠","定南","垫江","电白","德兴","东海","东阿","定远","定陶","东台","东山","东平","东明","东源",
|
||||
"东阳","东乡","洞头","都江堰","都昌","东至"
|
||||
]
|
||||
},
|
||||
{
|
||||
"letter": "E",
|
||||
"list": [
|
||||
"鄂尔多斯","恩施","恩平","鄂州"
|
||||
]
|
||||
},
|
||||
{
|
||||
"letter": "F",
|
||||
"list": [
|
||||
"佛山","福州","防城港","抚顺","阜新","阜阳","抚州","法库","富阳","福清","阜宁","阜南","富民","浮梁","福鼎",
|
||||
"福安","佛冈","分宜","凤阳","奉新","丰县","凤台","丰顺","封开","奉节","奉化","丰都","丰城","费县","肥西",
|
||||
"肥东","肥城","方正","繁昌"
|
||||
]
|
||||
},
|
||||
{
|
||||
"letter": "G",
|
||||
"list": [
|
||||
"广州","贵阳","甘南","赣州","甘孜","广安","广元","贵港","桂林","果洛","固原","赣县","赣榆","高安","固镇",
|
||||
"古田","贵溪","灌云","冠县","灌南","光泽","广饶","广宁","广丰","广德","广昌","巩义","高州","高邮","高邑",
|
||||
"高要","高唐","高青","高密","高陵","皋兰","高淳","藁城"
|
||||
]
|
||||
},
|
||||
{
|
||||
"letter": "H",
|
||||
"list": [
|
||||
"杭州","哈尔滨","邯郸","海口","黑河","合肥","鹤岗","河池","鹤壁","汉中","哈密","海西","海南","海东","海北",
|
||||
"惠州","呼伦贝尔","葫芦岛","呼和浩特","黄石","黄山","黄南","黄冈","淮南","怀化","淮北","淮安","红河","贺州",
|
||||
"菏泽","河源","和田地","衡阳","衡水","怀远","怀宁","怀集","桦甸","华安","洪泽","和县","鹤山","和平","横县",
|
||||
"横峰","合川","含山","海阳","海盐","海宁","海门","海丰","海安","湖州","户县","霍山","霍邱","呼兰","湖口",
|
||||
"惠民","惠来","惠东","会昌","惠安","化州","桓台"
|
||||
]
|
||||
},
|
||||
{
|
||||
"letter": "J",
|
||||
"list": [
|
||||
"鸡西","酒泉","九江","锦州","晋中","济宁","金华","荆州","荆门","景德镇","晋城","金昌","揭阳","嘉峪关","吉安",
|
||||
"江门","佳木斯","济南","吉林","嘉兴","焦作","井冈山","旌德","靖安","即墨","揭西","界首","揭东","嘉祥","嘉善",
|
||||
"胶州","胶南","蕉岭","蛟河","吉安","建阳","建瓯","建宁","建湖","江阴","姜堰","江山","将乐","江津","江都","建德",
|
||||
"九台","九江","吉水","晋州","金寨","缙云","金乡","金溪","进贤","金堂","金坛","晋宁","金门","晋江","金湖","井陉",
|
||||
"泾县","景宁","靖江","巨野","莒县","句容","莒南","鄄城","济源","济阳","绩溪"
|
||||
]
|
||||
},
|
||||
{
|
||||
"letter": "K",
|
||||
"list": [
|
||||
"昆明","开封","喀什地","克拉玛依","克孜勒","开化","开平","开县","开阳","康平","垦利","昆山"
|
||||
]
|
||||
},
|
||||
{
|
||||
"letter": "L",
|
||||
"list": [
|
||||
"连云港","凉山","乐山","拉萨","廊坊","莱芜","来宾","洛阳","柳州","兰州","六盘水","六安","丽水","林芝","临沂","临夏",
|
||||
"临汾","临沧","丽江","辽源","辽阳","聊城","乐亭","乐清","乐平","乐陵","雷州","乐昌","乐安","兰溪","蓝田","郎溪",
|
||||
"莱州","莱阳","莱西","来安","吕梁","泸州","漯河","娄底","龙岩","陇南","临邑","临沭","临朐","临泉","临清","临海",
|
||||
"陵县","灵寿","灵璧","临安","利津","黎川","辽中","连州","涟水","连山","连平","连南","廉江","连江","莲花","梁山",
|
||||
"梁平","连城","鹿寨","芦溪","禄劝","鹿泉","罗源","洛宁","罗定","庐江","陆河","陆丰","滦县","滦南","栾川","栾城",
|
||||
"龙游","龙泉","龙南","龙门","龙口","龙海","龙川","隆安","溧阳","利辛","浏阳","柳江","柳城","溧水"
|
||||
]
|
||||
},
|
||||
{
|
||||
"letter": "M",
|
||||
"list": [
|
||||
"马鞍山","茂名","眉山","梅州","绵阳","牡丹江","马山","梅县","蒙城","孟津","蒙阴","孟州","明光","明溪","闽侯","闽清",
|
||||
"木兰"
|
||||
]
|
||||
},
|
||||
{
|
||||
"letter": "N",
|
||||
"list": [
|
||||
"南昌","南京","南宁","南通","宁波","南充","南平","南阳","那曲","内江","宁德","怒江","南安","南澳","南城","南川","南丰",
|
||||
"南靖","南康","南陵","南雄","宁都","宁国","宁海","宁化","宁津","宁乡","宁阳","农安"
|
||||
]
|
||||
},
|
||||
{
|
||||
"letter": "P",
|
||||
"list": [
|
||||
"盘锦","攀枝花","平顶山","平凉","萍乡","普洱","莆田","濮阳","磐安","磐石","沛县","蓬莱","彭水","彭泽","彭州","平度",
|
||||
"平和","平湖","屏南","平山","平潭","平阳","平阴","平邑","平原","平远","郫县","邳州","鄱阳","浦城","浦江","蒲江","普兰店",
|
||||
"普宁"
|
||||
]
|
||||
},
|
||||
{
|
||||
"letter": "Q",
|
||||
"list": [
|
||||
"青岛","泉州","黔东","黔南","黔西南","庆阳","清远","秦皇岛","钦州","齐齐哈尔","七台河","曲靖","衢州","迁安","潜山","铅山",
|
||||
"迁西","启东","齐河","綦江","祁门","清流","青田","清新","青阳","庆元","庆云","清镇","青州","沁阳","邛崃","栖霞","全椒",
|
||||
"曲江","曲阜","全南"
|
||||
]
|
||||
},
|
||||
{
|
||||
"letter": "R",
|
||||
"list": [
|
||||
"日喀则","日照","饶平","仁化","融安","荣昌","荣成","融水","如东","如皋","瑞安","瑞昌","瑞金","乳山","汝阳","乳源"
|
||||
]
|
||||
},
|
||||
{
|
||||
"letter": "S",
|
||||
"list": [
|
||||
"上海","沈阳","深圳","石家庄","苏州","三门峡","三明","三亚","商丘","商洛","上饶","汕尾","汕头","绍兴","韶关","山南","邵阳",
|
||||
"十堰","双鸭山","石嘴山","绥化","松原","四平","朔州","泗阳","泗县","泗水","四会","泗洪","沭阳","顺昌","舒兰","舒城","双流",
|
||||
"双城","寿县","寿宁","寿光","石柱","始兴","石台","石狮","石林","石城","射阳","歙县","深泽","莘县","嵊州","嵊泗","沙县","绍兴",
|
||||
"邵武","尚志","上虞","上犹","上饶","上林","上栗","商河","上杭","上高","诏安","三门","三江","松阳","嵩县","松溪","嵩明","宿州",
|
||||
"宿迁","随州","遂宁","宿松","遂溪","濉溪","睢宁","遂川","遂昌","宿豫"
|
||||
]
|
||||
},
|
||||
{
|
||||
"letter": "T",
|
||||
"list": [
|
||||
"天津","台州","唐山","塔城地","泰安","太原","泰州","天水","铁岭","铜川","通化","通辽","铜陵","铜仁", "通州","桐乡","铜山","潼南",
|
||||
"桐庐","铜陵","铜梁","通河","铜鼓","桐城","天台","天长","滕州","唐海","郯城","泰兴","泰顺","台山","泰宁","太湖","泰和","太和","太仓",
|
||||
"吐鲁番"
|
||||
]
|
||||
},
|
||||
{
|
||||
"letter": "W",
|
||||
"list": [
|
||||
"潍坊","威海","武汉","无锡","渭南","文山","温州","乌海","芜湖","乌兰察布","乌鲁木齐","武威","吴忠","武陟","婺源","武夷山","武义","巫溪",
|
||||
"无为","巫山","武平","武宁","武鸣","武隆","五莲","吴江","无极","五华","芜湖","五河","无棣","吴川","武城","五常","涡阳","温县","汶上",
|
||||
"温岭","翁源","文登","文成","微山","万载","万年","望江","望城","万安","瓦房店","梧州"
|
||||
]
|
||||
},
|
||||
{
|
||||
"letter": "X",
|
||||
"list": [
|
||||
"厦门","西安","许昌","徐州","襄樊","湘潭","湘西","咸宁","咸阳","孝感","锡林郭勒盟","兴安盟","邢台","西宁","新乡","信阳","新余","忻州",
|
||||
"西双版纳","宣城","峡江","夏津","象山","响水","仙居","仙游","萧县","霞浦","息烽","新安","新昌","信丰","新丰","新干","兴国","兴化","兴宁",
|
||||
"行唐","荥阳","星子","辛集","新建","新津","新乐","新民","新密","新泰","新兴","新沂","信宜","新郑","休宁","秀山","修水","修文","修武",
|
||||
"寻甸","盱眙","徐闻","寻乌"
|
||||
]
|
||||
},
|
||||
{
|
||||
"letter": "Y",
|
||||
"list": [
|
||||
"扬州","烟台","雅安","延安","延边","盐城","阳江","阳泉","宜宾","宜昌","伊春","宜春","伊犁哈萨克","银川","营口","鹰潭","益阳","永州","岳阳",
|
||||
"玉林","榆林","运城","云浮","玉树","玉溪","阳春","阳东","阳谷","阳山","阳信","阳西","扬中","偃师","延寿","兖州","伊川","宜丰","宜黄","依兰",
|
||||
"宜良","沂南","英德","颍上","沂水","义乌","黟县","宜兴","弋阳","宜阳","沂源","仪征","永安","永川","永春","永登","永定","永丰","永吉","永嘉",
|
||||
"永康","邕宁","永泰","永新","永修","尤溪","酉阳","元氏","禹城","于都","岳西","余干","玉环","余江","郁南","云安","郓城","云和","云霄","云阳",
|
||||
"玉山","榆树","鱼台","玉田","余姚","榆中"
|
||||
]
|
||||
},
|
||||
{
|
||||
"letter": "Z",
|
||||
"list": [
|
||||
"漳州","遵化","郑州","中山","珠海","枣庄","张家界","张家口","张掖","湛江","肇庆","昭通","镇江","中卫","周口","舟山","驻马店","株洲","淄博",
|
||||
"自贡","资阳","遵义","赞皇","增城","张家港","漳平","漳浦","章丘","樟树","沾化","赵县","招远","正定","政和","柘荣","中牟","忠县","周宁",
|
||||
"周至","庄河","诸城","诸暨","紫金","资溪","邹城","邹平"
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
export default citys
|
||||
150
components/ss-select-city/ss-select-city.vue
Normal file
@ -0,0 +1,150 @@
|
||||
<template>
|
||||
<view class="select-city-wrap">
|
||||
<view class="select-city">
|
||||
<view class="index">
|
||||
<view class="index-item" @click="scrollTo('#')">#</view>
|
||||
<view class="index-item" v-for="item in citys" :key="item.letter" @click="scrollTo(item.letter)">{{item.letter}}</view>
|
||||
</view>
|
||||
<scroll-view :scroll-into-view="scrollIntoId" :scroll-y="true" :scroll-with-animation="true" :style="{height:windowHeight}">
|
||||
<view class="content">
|
||||
<view class="section" id="current">
|
||||
<view class="city-title">{{__('当前城市')}}</view>
|
||||
<view class="city-list">
|
||||
<view class="city-item">{{current}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="section" id="hot" v-if="hotCitys.length">
|
||||
<view class="city-title">{{__('热门城市')}}</view>
|
||||
<view class="city-list">
|
||||
<view class="city-item" :class="{active: current === city.subsite_name}" v-for="(city, i) in hotCitys" :key="i" @click="onSelect(city)">{{city.subsite_name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="section" :id="item.letter" v-for="item in citys" :key="item.letter">
|
||||
<view class="letter">{{item.letter}}</view>
|
||||
<view class="city-list">
|
||||
<view class="city-item" :class="{active: current === city.subsite_name}" v-for="(city,itemIndex) in item.list" :key="itemIndex" @click="onSelect(city)">{{city.subsite_name}}</view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
<script>
|
||||
//import Citys from './citys'
|
||||
export default {
|
||||
props: {
|
||||
citys: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
hotCitys: {
|
||||
type: Array,
|
||||
default () {
|
||||
return []
|
||||
}
|
||||
},
|
||||
subsite_current: {
|
||||
type: Object,
|
||||
default () {
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
windowHeight: '',
|
||||
scrollIntoId: 'F',
|
||||
current: this.subsite_current.subsite_name
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
let that = this;
|
||||
this.getSystemInfo()
|
||||
|
||||
setTimeout(function(){that.current = that.subsite_current.subsite_name}, 400)
|
||||
},
|
||||
methods: {
|
||||
getSystemInfo() {
|
||||
uni.getSystemInfo().then(res => {
|
||||
let [error, data] = res
|
||||
this.windowHeight = `${data.windowHeight}px`
|
||||
})
|
||||
},
|
||||
scrollTo(letter) {
|
||||
this.scrollIntoId = letter === '#' ? 'current' : letter
|
||||
},
|
||||
onSelect(city) {
|
||||
this.current = city.subsite_name
|
||||
this.$emit('input', city)
|
||||
this.$emit('on-select', city)
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.select-city-wrap {
|
||||
position: relative;
|
||||
padding: 0 30rpx;
|
||||
background-color: #fff;
|
||||
}
|
||||
.select-city {
|
||||
.index {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
bottom: 20rpx;
|
||||
z-index: 999;
|
||||
color: #2f9bfe;
|
||||
font-size: 32rpx;
|
||||
.index-item {
|
||||
width: 40rpx;
|
||||
height: 42rpx;
|
||||
line-height: 42rpx;
|
||||
text-align: center;
|
||||
}
|
||||
}
|
||||
.section {
|
||||
margin-bottom: 19rpx;
|
||||
.city-title {
|
||||
color: #333;
|
||||
font-size: 28rpx;
|
||||
margin-bottom: 28rpx;
|
||||
}
|
||||
.letter {
|
||||
width: 44rpx;
|
||||
height: 44rpx;
|
||||
color: #fff;
|
||||
border-radius: 100%;
|
||||
background-color: #2f9bfe;
|
||||
font-size: 28rpx;
|
||||
line-height: 44rpx;
|
||||
text-align: center;
|
||||
margin-bottom: 30rpx;
|
||||
}
|
||||
.city-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
.city-item {
|
||||
width: 190rpx;
|
||||
height: 55rpx;
|
||||
margin-right: 36rpx;
|
||||
margin-bottom: 28rpx;
|
||||
line-height: 55rpx;
|
||||
text-align: center;
|
||||
border: 1px solid #dcdcdc;
|
||||
border-radius: 6rpx;
|
||||
color: #999;
|
||||
font-size: 28rpx;
|
||||
&.active {
|
||||
background-color: #d5ebff;
|
||||
border-color: #2f9bfe;
|
||||
color: #2f9bfe;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -1,75 +1,38 @@
|
||||
<template>
|
||||
<view class="uni-navbar" :class="{'uni-dark':dark}">
|
||||
<view
|
||||
:class="{
|
||||
'uni-navbar--fixed': fixed,
|
||||
'uni-navbar--shadow': shadow,
|
||||
'uni-navbar--border': border,
|
||||
}"
|
||||
:style="{ 'background-color': themeBgColor }"
|
||||
class="uni-navbar__content"
|
||||
>
|
||||
<view :class="{ 'uni-navbar--fixed': fixed, 'uni-navbar--shadow': shadow, 'uni-navbar--border': border }"
|
||||
:style="{ 'background-color': themeBgColor }" class="uni-navbar__content">
|
||||
<status-bar v-if="statusBar" />
|
||||
<view
|
||||
:style="{
|
||||
color: themeColor,
|
||||
backgroundColor: themeBgColor,
|
||||
height: navbarHeight,
|
||||
}"
|
||||
class="uni-navbar__header"
|
||||
>
|
||||
<view
|
||||
@tap="onClickLeft"
|
||||
class="uni-navbar__header-btns uni-navbar__header-btns-left"
|
||||
:style="{ minWidth: leftIconWidth }"
|
||||
>
|
||||
<view :style="{ color: themeColor,backgroundColor: themeBgColor ,height:navbarHeight}"
|
||||
class="uni-navbar__header">
|
||||
<view @tap="onClickLeft" class="uni-navbar__header-btns uni-navbar__header-btns-left"
|
||||
:style="{width:leftIconWidth}">
|
||||
<slot name="left">
|
||||
<view class="uni-navbar__content_view" v-if="leftIcon.length > 0">
|
||||
<uni-icons :color="themeColor" :type="leftIcon" size="20" />
|
||||
</view>
|
||||
<view
|
||||
:class="{ 'uni-navbar-btn-icon-left': !leftIcon.length > 0 }"
|
||||
class="uni-navbar-btn-text"
|
||||
v-if="leftText.length"
|
||||
>
|
||||
<text :style="{ color: themeColor, fontSize: '12px' }">{{
|
||||
leftText
|
||||
}}</text>
|
||||
<view :class="{ 'uni-navbar-btn-icon-left': !leftIcon.length > 0 }" class="uni-navbar-btn-text"
|
||||
v-if="leftText.length">
|
||||
<text :style="{ color: themeColor, fontSize: '12px' }">{{ leftText }}</text>
|
||||
</view>
|
||||
</slot>
|
||||
</view>
|
||||
<view class="uni-navbar__header-container " @tap="onClickTitle">
|
||||
<slot>
|
||||
<view
|
||||
class="uni-navbar__header-container-inner"
|
||||
v-if="title.length > 0"
|
||||
>
|
||||
<text
|
||||
class="uni-nav-bar-text uni-ellipsis-1"
|
||||
:style="{ color: themeColor }"
|
||||
>{{ title }}</text
|
||||
>
|
||||
<view class="uni-navbar__header-container-inner" v-if="title.length>0">
|
||||
<text class="uni-nav-bar-text uni-ellipsis-1"
|
||||
:style="{color: themeColor }">{{ title }}</text>
|
||||
</view>
|
||||
</slot>
|
||||
</view>
|
||||
<view
|
||||
@click="onClickRight"
|
||||
class="uni-navbar__header-btns uni-navbar__header-btns-right"
|
||||
:style="{ width: rightIconWidth }"
|
||||
>
|
||||
<view @click="onClickRight" class="uni-navbar__header-btns uni-navbar__header-btns-right"
|
||||
:style="{width:rightIconWidth}">
|
||||
<slot name="right">
|
||||
<view v-if="rightIcon.length">
|
||||
<uni-icons :color="themeColor" :type="rightIcon" size="22" />
|
||||
</view>
|
||||
<view
|
||||
class="uni-navbar-btn-text"
|
||||
v-if="rightText.length && !rightIcon.length"
|
||||
>
|
||||
<text
|
||||
class="uni-nav-bar-right-text"
|
||||
:style="{ color: themeColor }"
|
||||
>{{ rightText }}</text
|
||||
>
|
||||
<view class="uni-navbar-btn-text" v-if="rightText.length && !rightIcon.length">
|
||||
<text class="uni-nav-bar-right-text" :style="{ color: themeColor}">{{ rightText }}</text>
|
||||
</view>
|
||||
</slot>
|
||||
</view>
|
||||
@ -77,17 +40,14 @@
|
||||
</view>
|
||||
<view class="uni-navbar__placeholder" v-if="fixed">
|
||||
<status-bar v-if="statusBar" />
|
||||
<view
|
||||
class="uni-navbar__placeholder-view"
|
||||
:style="{ height: navbarHeight }"
|
||||
/>
|
||||
<view class="uni-navbar__placeholder-view" :style="{ height:navbarHeight}" />
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import statusBar from "./uni-status-bar.vue";
|
||||
const getVal = (val) => (typeof val === "number" ? val + "px" : val);
|
||||
const getVal = (val) => typeof val === 'number' ? val + 'px' : val;
|
||||
|
||||
/**
|
||||
* NavBar 自定义导航栏
|
||||
@ -112,111 +72,111 @@ const getVal = (val) => (typeof val === "number" ? val + "px" : val);
|
||||
export default {
|
||||
name: "UniNavBar",
|
||||
components: {
|
||||
statusBar,
|
||||
statusBar
|
||||
},
|
||||
emits: ["clickLeft", "clickRight", "clickTitle"],
|
||||
emits: ['clickLeft', 'clickRight', 'clickTitle'],
|
||||
props: {
|
||||
dark: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
default: false
|
||||
},
|
||||
title: {
|
||||
type: String,
|
||||
default: "",
|
||||
default: ""
|
||||
},
|
||||
leftText: {
|
||||
type: String,
|
||||
default: "",
|
||||
default: ""
|
||||
},
|
||||
rightText: {
|
||||
type: String,
|
||||
default: "",
|
||||
default: ""
|
||||
},
|
||||
leftIcon: {
|
||||
type: String,
|
||||
default: "",
|
||||
default: ""
|
||||
},
|
||||
rightIcon: {
|
||||
type: String,
|
||||
default: "",
|
||||
default: ""
|
||||
},
|
||||
fixed: {
|
||||
type: [Boolean, String],
|
||||
default: false,
|
||||
default: false
|
||||
},
|
||||
color: {
|
||||
type: String,
|
||||
default: "",
|
||||
default: ""
|
||||
},
|
||||
backgroundColor: {
|
||||
type: String,
|
||||
default: "",
|
||||
default: ""
|
||||
},
|
||||
statusBar: {
|
||||
type: [Boolean, String],
|
||||
default: false,
|
||||
default: false
|
||||
},
|
||||
shadow: {
|
||||
type: [Boolean, String],
|
||||
default: false,
|
||||
default: false
|
||||
},
|
||||
border: {
|
||||
type: [Boolean, String],
|
||||
default: true,
|
||||
default: true
|
||||
},
|
||||
height: {
|
||||
type: [Number, String],
|
||||
default: 44,
|
||||
default: 44
|
||||
},
|
||||
leftWidth: {
|
||||
type: [Number, String],
|
||||
default: 60,
|
||||
default: 60
|
||||
},
|
||||
rightWidth: {
|
||||
type: [Number, String],
|
||||
default: 60,
|
||||
default: 60
|
||||
},
|
||||
stat: {
|
||||
type: [Boolean, String],
|
||||
default: "",
|
||||
},
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
themeBgColor() {
|
||||
if (this.dark) {
|
||||
// 默认值
|
||||
if (this.backgroundColor) {
|
||||
return this.backgroundColor;
|
||||
return this.backgroundColor
|
||||
} else {
|
||||
return this.dark ? "#333" : "#FFF";
|
||||
return this.dark ? '#333' : '#FFF'
|
||||
}
|
||||
}
|
||||
return this.backgroundColor || "#FFF";
|
||||
return this.backgroundColor || '#FFF'
|
||||
},
|
||||
themeColor() {
|
||||
if (this.dark) {
|
||||
// 默认值
|
||||
if (this.color) {
|
||||
return this.color;
|
||||
return this.color
|
||||
} else {
|
||||
return this.dark ? "#fff" : "#333";
|
||||
return this.dark ? '#fff' : '#333'
|
||||
}
|
||||
}
|
||||
return this.color || "#333";
|
||||
return this.color || '#333'
|
||||
},
|
||||
navbarHeight() {
|
||||
return getVal(this.height);
|
||||
return getVal(this.height)
|
||||
},
|
||||
leftIconWidth() {
|
||||
return getVal(this.leftWidth);
|
||||
return getVal(this.leftWidth)
|
||||
},
|
||||
rightIconWidth() {
|
||||
return getVal(this.rightWidth);
|
||||
},
|
||||
return getVal(this.rightWidth)
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if (uni.report && this.stat && this.title !== "") {
|
||||
uni.report("title", this.title);
|
||||
if (uni.report && this.stat && this.title !== '') {
|
||||
uni.report('title', this.title)
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -228,8 +188,8 @@ export default {
|
||||
},
|
||||
onClickTitle() {
|
||||
this.$emit("clickTitle");
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -278,11 +238,11 @@ $nav-height: 44px;
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
padding: 5px 10px;
|
||||
padding: 0 10px;
|
||||
padding-top: 10rpx;
|
||||
flex-direction: row;
|
||||
height: $nav-height;
|
||||
font-size: 12px;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.uni-navbar__header-btns {
|
||||
@ -292,7 +252,7 @@ $nav-height: 44px;
|
||||
/* #endif */
|
||||
flex-wrap: nowrap;
|
||||
flex-direction: row;
|
||||
// width: 120rpx;
|
||||
width: 120rpx;
|
||||
// padding: 0 6px;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
@ -305,7 +265,7 @@ $nav-height: 44px;
|
||||
/* #ifndef APP-NVUE */
|
||||
display: flex;
|
||||
/* #endif */
|
||||
min-width: 120rpx;
|
||||
width: 120rpx;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
}
|
||||
@ -343,6 +303,7 @@ $nav-height: 44px;
|
||||
// box-sizing: border-box;
|
||||
}
|
||||
|
||||
|
||||
.uni-navbar__placeholder-view {
|
||||
height: $nav-height;
|
||||
}
|
||||
@ -358,6 +319,7 @@ $nav-height: 44px;
|
||||
left: 0;
|
||||
right: 0;
|
||||
/* #endif */
|
||||
|
||||
}
|
||||
|
||||
.uni-navbar--shadow {
|
||||
@ -383,6 +345,5 @@ $nav-height: 44px;
|
||||
}
|
||||
|
||||
// 暗主题配置
|
||||
.uni-dark {
|
||||
}
|
||||
.uni-dark {}
|
||||
</style>
|
||||
|
||||
@ -1,158 +1,80 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<view :class="show ? 'cover' : ''"> </view>
|
||||
<view :class="(show?'cover':'')">
|
||||
|
||||
</view>
|
||||
<view class="m-product-all">
|
||||
<view class="m-tab">
|
||||
<view class="m-navbar">
|
||||
<view
|
||||
:class="[
|
||||
'm-navbar-item ellipsis',
|
||||
tapindex == 1 ? 'm-navbar-item-on' : '',
|
||||
]"
|
||||
@click="allOrders"
|
||||
>
|
||||
{{ __("全部") }}
|
||||
<view :class="['m-navbar-item ellipsis', tapindex==1?'m-navbar-item-on':'']" @click="allOrders">
|
||||
{{__('全部')}}
|
||||
</view>
|
||||
<view
|
||||
:class="[
|
||||
'm-navbar-item ellipsis',
|
||||
tapindex == 2 ? 'm-navbar-item-on' : '',
|
||||
]"
|
||||
@click="getTender"
|
||||
>
|
||||
{{ __("匹配中") }}
|
||||
<view :class="['m-navbar-item ellipsis', tapindex==2?'m-navbar-item-on':'']" @click="getTender">
|
||||
{{__('匹配中')}}
|
||||
</view>
|
||||
<view
|
||||
:class="[
|
||||
'm-navbar-item ellipsis',
|
||||
tapindex == 3 ? 'm-navbar-item-on' : '',
|
||||
]"
|
||||
@click="getWorking"
|
||||
>
|
||||
{{ __("已结束") }}
|
||||
<view :class="['m-navbar-item ellipsis', tapindex==3?'m-navbar-item-on':'']" @click="getWorking">
|
||||
{{__('已结束')}}
|
||||
</view>
|
||||
<view
|
||||
:class="[
|
||||
'm-navbar-item ellipsis',
|
||||
tapindex == 4 ? 'm-navbar-item-on' : '',
|
||||
]"
|
||||
@click="getFinished"
|
||||
>
|
||||
{{ __("已取消") }}
|
||||
<view :class="['m-navbar-item ellipsis', tapindex==4?'m-navbar-item-on':'']" @click="getFinished">
|
||||
{{__('已取消')}}
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="loadComplete">
|
||||
<scroll-view
|
||||
v-if="orderlist.length > 0"
|
||||
scroll-y="true"
|
||||
class="m-orderlist"
|
||||
@scrolltolower="scrollbottom"
|
||||
>
|
||||
<view
|
||||
v-for="(items, i) in orderlist"
|
||||
:key="i"
|
||||
class="m-panel m-panel-access"
|
||||
>
|
||||
<scroll-view v-if="(orderlist.length>0)" scroll-y="true" class="m-orderlist" @scrolltolower="scrollbottom">
|
||||
<view v-for="(items, i) in orderlist" :key="i" class="m-panel m-panel-access">
|
||||
<view class="m-panel-hd">
|
||||
<view>
|
||||
<text>{{ __("采购编号:") }}{{ items.purchase_order_id }}</text>
|
||||
<text>{{__('采购编号:')}}{{items.purchase_order_id}}</text>
|
||||
<label>{{items.supply_order_time}}</label>
|
||||
</view>
|
||||
<view>
|
||||
<label
|
||||
style="padding-right: 10rpx"
|
||||
v-if="items.supply_task_state == 2000"
|
||||
>{{ __("竞标中") }}</label
|
||||
>
|
||||
<label
|
||||
style="padding-right: 10rpx"
|
||||
v-if="items.supply_task_state == 2010"
|
||||
>{{ __("已结束") }}</label
|
||||
>
|
||||
<label
|
||||
style="padding-right: 10rpx"
|
||||
v-if="items.supply_task_state == 2020"
|
||||
>{{ __("已取消") }}</label
|
||||
>
|
||||
<label style="padding-right: 10rpx;" v-if="items.supply_task_state == 2000">{{__('竞标中')}}</label>
|
||||
<label style="padding-right: 10rpx;" v-if="items.supply_task_state == 2010">{{__('已结束')}}</label>
|
||||
<label style="padding-right: 10rpx;" v-if="items.supply_task_state == 2020">{{__('已取消')}}</label>
|
||||
</view>
|
||||
<view>
|
||||
<text
|
||||
>{{ __("报价标题:") }}{{ items.supply_order_title }}</text
|
||||
>
|
||||
<text>{{__('报价标题:')}}{{items.supply_order_title}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text
|
||||
>{{ __("报价描述:")
|
||||
}}{{ items.supply_order_description }}</text
|
||||
>
|
||||
<text>{{__('报价描述:')}}{{items.supply_order_description}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="m-product-list">
|
||||
<navigator
|
||||
:url="
|
||||
'/hall/purchase/detail?order_id=' + items.service_order_id
|
||||
"
|
||||
class="m-product-item"
|
||||
>
|
||||
<navigator :url="'/hall/purchase/detail?order_id=' + (items.service_order_id)" class="m-product-item">
|
||||
<view class="m-product-item">
|
||||
<view class="m-product-img">
|
||||
<image :src="items.supply_images[0]" mode="aspectFill" />
|
||||
<image :src="(items.supply_images[0])" mode="aspectFill" />
|
||||
</view>
|
||||
<view class="m-product-info">
|
||||
<view class="m-product-name" style="height: 65rpx">
|
||||
<view class="m-product-name" style="height:65rpx;">
|
||||
<label>
|
||||
{{items.product_name}}
|
||||
</label>
|
||||
</view>
|
||||
<view
|
||||
class="m-product-name"
|
||||
style="height: 65rpx"
|
||||
v-if="items.supply_province && items.supply_city"
|
||||
>
|
||||
<view class="m-product-name" style="height:65rpx;" v-if="(items.supply_province && items.supply_city)">
|
||||
<label>
|
||||
{{ items.supply_province }}/{{ items.supply_city }}/{{
|
||||
items.supply_county
|
||||
}}
|
||||
{{items.supply_province}}/{{items.supply_city}}/{{items.supply_county}}
|
||||
</label>
|
||||
</view>
|
||||
|
||||
<view class="m-product-price">
|
||||
<block>
|
||||
<label
|
||||
>{{ __("¥") }}{{ items.product_unit_price }}
|
||||
</label>
|
||||
<label style="margin-left: 50rpx"
|
||||
>x{{ items.supply_quantity }}</label
|
||||
>
|
||||
<label>{{__('¥')}}{{items.product_unit_price}} </label> <label style="margin-left: 50rpx;">x{{items.supply_quantity}}</label>
|
||||
</block>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="m-product-select">
|
||||
<text
|
||||
v-if="
|
||||
items.supply_task_state == 2010 &&
|
||||
items.supply_is_selected
|
||||
"
|
||||
>{{ __("已中标") }}</text
|
||||
>
|
||||
<text v-if="(items.supply_task_state==2010 && items.supply_is_selected)">{{__('已中标')}}</text>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
<!-- items.Type==2 ???? -->
|
||||
<view
|
||||
class="m-product-item"
|
||||
v-if="items.Type == 2"
|
||||
style="height: 154rpx"
|
||||
>
|
||||
<view class="m-product-item" v-if="(items.Type==2)" style="height:154rpx">
|
||||
<view class="m-product-img">
|
||||
<image
|
||||
:src="items.store_logo"
|
||||
mode="aspectFill"
|
||||
style="width: 172rpx; height: 172rpx"
|
||||
/>
|
||||
<image :src="(items.store_logo)" mode="aspectFill" style="width:172rpx;height:172rpx" />
|
||||
</view>
|
||||
<view class="m-product-info2" style="padding:20rpx 0">
|
||||
<view class="m-product-name">
|
||||
@ -161,37 +83,18 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="m-total-btn">
|
||||
<view
|
||||
:data-on="items.order_id"
|
||||
v-if="items.order_lock_status"
|
||||
class="u-link-btn"
|
||||
>{{ __("退款/退货中...") }}</view
|
||||
>
|
||||
<view
|
||||
:data-on="items.order_id"
|
||||
v-if="
|
||||
items.kind_id == 1202 &&
|
||||
items.order_state_id == StateCode.ORDER_STATE_SHIPPED
|
||||
"
|
||||
class="u-link-btn"
|
||||
@click="writeOrder"
|
||||
>{{ __("确认服务") }}</view
|
||||
>
|
||||
<view :data-on="(items.order_id)" v-if="(items.order_lock_status)" class="u-link-btn">{{__('退款/退货中...')}}</view>
|
||||
<view :data-on="(items.order_id)" v-if="(items.kind_id==1202 && items.order_state_id == StateCode.ORDER_STATE_SHIPPED)" class="u-link-btn"
|
||||
@click="writeOrder">{{__('确认服务')}}</view>
|
||||
<!-- <view :data-on="(items.supply_order_id)" v-if="(!items.supply_is_selected)" class="u-link-btn" @click="cancelOrder">{{__('取消订单')}}</view> -->
|
||||
<navigator
|
||||
:url="
|
||||
'/hall/purchase/detail?order_id=' + items.purchase_order_id
|
||||
"
|
||||
class="u-link-btn"
|
||||
>{{ __("查看详情") }}</navigator
|
||||
>
|
||||
<navigator :url="'/hall/purchase/detail?order_id=' + (items.purchase_order_id)" class="u-link-btn">{{__('查看详情')}}</navigator>
|
||||
</view>
|
||||
</view>
|
||||
<view class="m-loading-box">
|
||||
<block v-if="ispage">
|
||||
<block v-if="(ispage)">
|
||||
<view class="u-loadmore">
|
||||
<label class="u-loading"></label>
|
||||
<text class="u-loadmore-tips">{{ __("正在加载") }}</text>
|
||||
<text class="u-loadmore-tips">{{__('正在加载')}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text></text>
|
||||
@ -199,55 +102,41 @@
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="u-loadmore u-loadmore-line">
|
||||
<text class="u-loadmore-tips">{{
|
||||
__("没有更多数据啦!")
|
||||
}}</text>
|
||||
<text class="u-loadmore-tips">{{__('没有更多数据啦!')}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<navigator
|
||||
url="/hall/purchase/lists"
|
||||
redirect="true"
|
||||
class="m-nullpage"
|
||||
v-else
|
||||
>
|
||||
<navigator url="/hall/purchase/lists" redirect="true" class="m-nullpage" v-else>
|
||||
<view class="m-nullpage-middle">
|
||||
<view class="m-null-tip">
|
||||
<label style="font-size: 32rpx">{{
|
||||
__("亲~您还没有任务哦,")
|
||||
}}</label
|
||||
><label class="highlight-link">{{ __("快去看看吧") }}</label>
|
||||
<label style="font-size:32rpx;">{{__('亲~您还没有任务哦,')}}</label><label class="highlight-link">{{__('快去看看吧')}}</label>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
<view class="alert" v-if="show">
|
||||
<image
|
||||
style="width: 50rpx; height: 50rpx"
|
||||
src="https://static.lancerdt.com/xcxfile/appicon/images/true.png"
|
||||
></image>
|
||||
<view class="alert" v-if="(show)">
|
||||
<image style="width:50rpx;height:50rpx" src="https://static.lancerdt.com/xcxfile/appicon/images/true.png"></image>
|
||||
<text style="margin-left:20rpx">{{Info}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<payment-box
|
||||
:paymentDataDefault="paymentData"
|
||||
:order_id="order_id"
|
||||
ref="paymentBox"
|
||||
@onCancel="onCancel"
|
||||
@onPaid="onPaid"
|
||||
@onFail="onFail"
|
||||
></payment-box>
|
||||
|
||||
<payment-box :paymentDataDefault="paymentData" :order_id="order_id" ref="paymentBox" @onCancel="onCancel" @onPaid="onPaid" @onFail="onFail"></payment-box>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import paymentBox from "../../components/payment-box.vue";
|
||||
|
||||
import { mapState, mapMutations } from "vuex";
|
||||
import paymentBox from '../../components/payment-box.vue'
|
||||
|
||||
import {
|
||||
mapState,
|
||||
mapMutations
|
||||
} from 'vuex'
|
||||
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -267,24 +156,16 @@ export default {
|
||||
Info: "",
|
||||
order_id: "",
|
||||
paymentData:{},
|
||||
loadComplete: false,
|
||||
};
|
||||
loadComplete : false
|
||||
}
|
||||
},
|
||||
components: {
|
||||
paymentBox,
|
||||
paymentBox
|
||||
},
|
||||
computed: mapState([
|
||||
"Config",
|
||||
"StateCode",
|
||||
"notice",
|
||||
"plantformInfo",
|
||||
"shopInfo",
|
||||
"userInfo",
|
||||
"hasLogin",
|
||||
]),
|
||||
computed: mapState(['Config', 'StateCode', 'notice', 'plantformInfo', 'shopInfo', 'userInfo', 'hasLogin']),
|
||||
onLoad: function(options) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.__("我的报价"),
|
||||
title:this.__('我的报价')
|
||||
});
|
||||
|
||||
this.setData({
|
||||
@ -293,20 +174,21 @@ export default {
|
||||
rows: 10,
|
||||
orderlist: [],
|
||||
type: options.type ? options.type : 0,
|
||||
kind_id: options.kind_id ? options.kind_id : 1201,
|
||||
kind_id: options.kind_id ? options.kind_id : 1201
|
||||
});
|
||||
var t = this;
|
||||
this.notice.addNotification("RefreshMessage", t.RefreshMessage, t);
|
||||
this.getOrderlist();
|
||||
this.getOrderlist()
|
||||
},
|
||||
onShow: function() {},
|
||||
|
||||
onUnload: function() {
|
||||
//移除通知
|
||||
// 离开页面,注销事件
|
||||
var that = this;
|
||||
var that = this
|
||||
this.notice.removeNotification("RefreshMessage", that);
|
||||
|
||||
|
||||
if (this.$refs.paymentBox.showBoxView) {
|
||||
this.$refs.paymentBox.cancel();
|
||||
}
|
||||
@ -325,13 +207,7 @@ export default {
|
||||
this.getOrderlist();
|
||||
},
|
||||
methods: {
|
||||
...mapMutations([
|
||||
"login",
|
||||
"logout",
|
||||
"getPlantformInfo",
|
||||
"forceUserInfo",
|
||||
"getUserInfo",
|
||||
]),
|
||||
...mapMutations(['login', 'logout', 'getPlantformInfo', 'forceUserInfo', 'getUserInfo']),
|
||||
RefreshMessage: function(e) {
|
||||
this.setData({
|
||||
tapindex: 1,
|
||||
@ -342,9 +218,8 @@ export default {
|
||||
flag: true,
|
||||
type: 0,
|
||||
kind_id: this.kind_id,
|
||||
loadComplete: false,
|
||||
}),
|
||||
this.getOrderlist();
|
||||
loadComplete: false
|
||||
}), this.getOrderlist()
|
||||
},
|
||||
allOrders: function() {
|
||||
this.setData({
|
||||
@ -356,9 +231,8 @@ export default {
|
||||
flag: true,
|
||||
type: 0,
|
||||
kind_id: this.kind_id,
|
||||
loadComplete: false,
|
||||
}),
|
||||
this.getOrderlist();
|
||||
loadComplete: false
|
||||
}), this.getOrderlist()
|
||||
},
|
||||
getTender: function() {
|
||||
this.setData({
|
||||
@ -370,9 +244,8 @@ export default {
|
||||
flag: true,
|
||||
type: 2000,
|
||||
kind_id: this.kind_id,
|
||||
loadComplete: false,
|
||||
}),
|
||||
this.getOrderlist();
|
||||
loadComplete: false
|
||||
}), this.getOrderlist()
|
||||
},
|
||||
getWorking: function() {
|
||||
this.setData({
|
||||
@ -384,9 +257,8 @@ export default {
|
||||
flag: true,
|
||||
type: 2010,
|
||||
kind_id: this.kind_id,
|
||||
loadComplete: false,
|
||||
}),
|
||||
this.getOrderlist();
|
||||
loadComplete: false
|
||||
}), this.getOrderlist()
|
||||
},
|
||||
receiptOfGoods: function() {
|
||||
this.setData({
|
||||
@ -396,14 +268,10 @@ export default {
|
||||
ispage: true,
|
||||
flag: true,
|
||||
orderlist: [],
|
||||
type:
|
||||
this.kind_id == 1201
|
||||
? this.StateCode.ORDER_STATE_SHIPPED
|
||||
: this.StateCode.ORDER_STATE_WAIT_SHIPPING,
|
||||
type: this.kind_id==1201 ? this.StateCode.ORDER_STATE_SHIPPED : this.StateCode.ORDER_STATE_WAIT_SHIPPING,
|
||||
kind_id: this.kind_id,
|
||||
loadComplete: false,
|
||||
}),
|
||||
this.getOrderlist();
|
||||
loadComplete: false
|
||||
}), this.getOrderlist()
|
||||
},
|
||||
getFinished: function() {
|
||||
this.setData({
|
||||
@ -415,15 +283,14 @@ export default {
|
||||
orderlist: [],
|
||||
type: 2020,
|
||||
kind_id: this.kind_id,
|
||||
loadComplete: false,
|
||||
}),
|
||||
this.getOrderlist();
|
||||
loadComplete: false
|
||||
}), this.getOrderlist()
|
||||
},
|
||||
scrollbottom: function() {
|
||||
if (this.flag) {
|
||||
var that = this;
|
||||
that.setData({
|
||||
flag: false,
|
||||
flag: false
|
||||
});
|
||||
|
||||
clearTimeout(t);
|
||||
@ -432,11 +299,11 @@ export default {
|
||||
state_type: that.type,
|
||||
flag: false,
|
||||
page: parseInt(that.page) + 1,
|
||||
rows: 10,
|
||||
rows: 10
|
||||
});
|
||||
|
||||
that.getOrderlist();
|
||||
}, 100);
|
||||
that.getOrderlist()
|
||||
}, 100)
|
||||
}
|
||||
},
|
||||
getOrderlist: function() {
|
||||
@ -445,7 +312,7 @@ export default {
|
||||
page: that.page,
|
||||
rows: that.rows,
|
||||
state_type: that.type,
|
||||
kind_id: this.kind_id,
|
||||
kind_id: this.kind_id
|
||||
};
|
||||
that.$.request({
|
||||
url: this.Config.URL.hall.user_supply_order_lists,
|
||||
@ -456,45 +323,44 @@ export default {
|
||||
that.setData({
|
||||
flag: false,
|
||||
ispage: false,
|
||||
orderlist: that.orderlist.concat(data.items),
|
||||
});
|
||||
orderlist: that.orderlist.concat(data.items)
|
||||
})
|
||||
} else {
|
||||
that.setData({
|
||||
flag: true,
|
||||
ispage: true,
|
||||
orderlist: that.orderlist.concat(data.items),
|
||||
});
|
||||
orderlist: that.orderlist.concat(data.items)
|
||||
})
|
||||
}
|
||||
|
||||
that.setData({
|
||||
isdata: true,
|
||||
loadComplete: true,
|
||||
});
|
||||
loadComplete : true
|
||||
})
|
||||
|
||||
} else {
|
||||
that.setData({
|
||||
flag: false,
|
||||
ispage: false,
|
||||
isdata: false,
|
||||
loadComplete: true,
|
||||
});
|
||||
loadComplete : true
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: function(data) {
|
||||
that.setData({
|
||||
loadComplete: true,
|
||||
loadComplete: true
|
||||
});
|
||||
that.$.alert("网络异常请重试!");
|
||||
},
|
||||
}
|
||||
});
|
||||
},
|
||||
cancelOrder: function(e) {
|
||||
var that = this,
|
||||
params = {
|
||||
order_id: e.currentTarget.dataset.on,
|
||||
order_id: e.currentTarget.dataset.on
|
||||
};
|
||||
that.$.confirm(
|
||||
that.__("是否取消订单"),
|
||||
function (e) {
|
||||
that.$.confirm(that.__("是否取消订单"), function(e) {
|
||||
if (e.confirm) {
|
||||
that.$.request({
|
||||
url: that.Config.URL.user.order_cancel,
|
||||
@ -504,26 +370,22 @@ export default {
|
||||
that.$.alert("取消成功!", function() {
|
||||
that.setData({
|
||||
orderlist: [],
|
||||
page: 1,
|
||||
page: 1
|
||||
});
|
||||
that.getOrderlist();
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
}, true)
|
||||
},
|
||||
writeOrder: function(e) {
|
||||
var that = this,
|
||||
params = {
|
||||
order_id: e.currentTarget.dataset.on,
|
||||
order_id: e.currentTarget.dataset.on
|
||||
};
|
||||
that.$.confirm(
|
||||
"是否核销订单?",
|
||||
function (e) {
|
||||
that.$.confirm("是否核销订单?", function(e) {
|
||||
if (e.confirm) {
|
||||
that.$.request({
|
||||
url: that.Config.URL.user.order_receive,
|
||||
@ -534,37 +396,32 @@ export default {
|
||||
that.setData({
|
||||
orderlist: [],
|
||||
page: 1,
|
||||
Info: msg,
|
||||
Info: msg
|
||||
});
|
||||
that.getOrderlist();
|
||||
});
|
||||
} else {
|
||||
(that.setData({
|
||||
show: true,
|
||||
}),
|
||||
setTimeout(function () {
|
||||
show: true
|
||||
}), setTimeout(function() {
|
||||
that.setData({
|
||||
show: false,
|
||||
});
|
||||
}, 2e3)),
|
||||
that.getOrderlist();
|
||||
show: false
|
||||
})
|
||||
}, 2e3)), that.getOrderlist()
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
|
||||
}, true)
|
||||
},
|
||||
confirmReceipt: function(obj) {
|
||||
var params = {
|
||||
order_id: obj.currentTarget.dataset.on,
|
||||
order_id: obj.currentTarget.dataset.on
|
||||
};
|
||||
|
||||
var that = this;
|
||||
that.$.confirm(
|
||||
that.__("是否确认收货?"),
|
||||
function (e) {
|
||||
that.$.confirm(that.__("是否确认收货?"), function(e) {
|
||||
if (e.confirm) {
|
||||
that.$.request({
|
||||
url: that.Config.URL.user.order_receive,
|
||||
@ -574,46 +431,46 @@ export default {
|
||||
that.$.alert(that.__("收货成功!"), function() {
|
||||
that.setData({
|
||||
orderlist: [],
|
||||
page: 1,
|
||||
page: 1
|
||||
});
|
||||
that.getOrderlist();
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
|
||||
}, true)
|
||||
},
|
||||
gotopay: function(e) {
|
||||
var that = this;
|
||||
|
||||
that.setData({
|
||||
order_id: e.currentTarget.dataset.on,
|
||||
paymentData: {
|
||||
'paymentData': {
|
||||
order_id: e.currentTarget.dataset.on,
|
||||
orderSelMoneyAmount: e.currentTarget.dataset.order_payment_amount,
|
||||
|
||||
user_money: this.userInfo.user_money,
|
||||
user_points:this.userInfo.user_points,
|
||||
user_recharge_card:this.userInfo.user_recharge_card,
|
||||
user_sp: this.userInfo.user_sp,
|
||||
},
|
||||
user_sp:this.userInfo.user_sp
|
||||
}
|
||||
});
|
||||
|
||||
this.$refs.paymentBox.show();
|
||||
return true;
|
||||
|
||||
|
||||
this.setData({
|
||||
formId: e.detail.formId,
|
||||
formId: e.detail.formId
|
||||
});
|
||||
var param = {
|
||||
order_id: e.currentTarget.dataset.on,
|
||||
openid: this.userInfo.openId,
|
||||
typ: "json",
|
||||
payment_channel_code: "wx_native",
|
||||
prepay_flag: 1,
|
||||
typ: 'json',
|
||||
payment_channel_code: 'wx_native',
|
||||
prepay_flag: 1
|
||||
};
|
||||
|
||||
that.$.request({
|
||||
@ -624,50 +481,43 @@ export default {
|
||||
that.$.requestPayment({
|
||||
timeStamp: data.timeStamp,
|
||||
nonceStr: data.nonceStr,
|
||||
package: data.package,
|
||||
"package": data.package,
|
||||
signType: data.signType,
|
||||
paySign: data.paySign,
|
||||
success: function() {
|
||||
that.sendMessage(e.currentTarget.dataset.on),
|
||||
that.$.alert(that.__("支付成功!"), function () {
|
||||
that.sendMessage(e.currentTarget.dataset.on), that.$.alert(that.__("支付成功!"), function() {
|
||||
that.setData({
|
||||
orderlist: [],
|
||||
page: 1,
|
||||
}),
|
||||
that.getOrderlist();
|
||||
});
|
||||
page: 1
|
||||
}), that.getOrderlist()
|
||||
})
|
||||
},
|
||||
fail: function(e) {
|
||||
// that.$.alert(that.__("支付成功!"), e)
|
||||
},
|
||||
});
|
||||
}
|
||||
})
|
||||
} else {
|
||||
that.$.alert(msg);
|
||||
that.$.alert(msg)
|
||||
}
|
||||
},
|
||||
|
||||
fail: function (err) {},
|
||||
fail: function(err) {}
|
||||
});
|
||||
},
|
||||
|
||||
onCancel: function(e) {
|
||||
return;
|
||||
return
|
||||
},
|
||||
onPaid: function(e) {
|
||||
let that = this;
|
||||
that.$.alert(
|
||||
that.__("支付成功"),
|
||||
function () {
|
||||
that.$.gotopage("/member/order/detail?on=" + e.order_id);
|
||||
},
|
||||
2000
|
||||
);
|
||||
let that = this
|
||||
that.$.alert(that.__('支付成功'), function(){that.$.gotopage("/member/order/detail?on=" + e.order_id)}, 2000)
|
||||
|
||||
if (this.$refs.paymentBox.showBoxView) {
|
||||
this.$refs.paymentBox.cancel();
|
||||
}
|
||||
},
|
||||
onFail: function (e) {},
|
||||
onFail: function(e) {
|
||||
},
|
||||
|
||||
sendMessage: function(order_id) {
|
||||
let that = this;
|
||||
@ -677,12 +527,12 @@ export default {
|
||||
formId: this.formId,
|
||||
WeiXinOpenId: this.userInfo.openId,
|
||||
value: {
|
||||
order_id: order_id,
|
||||
},
|
||||
order_id: order_id
|
||||
}
|
||||
};
|
||||
that.$.sendTpl(params);
|
||||
},
|
||||
},
|
||||
that.$.sendTpl(params)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -709,9 +559,10 @@ export default {
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
height: 6rpx;
|
||||
height:
|
||||
6rpx;
|
||||
border-bottom: 6rpx solid $default-skin-bg;
|
||||
color: #cccccc;
|
||||
color: #CCCCCC;
|
||||
-webkit-transform-origin: 0 100%;
|
||||
transform-origin: 0 100%;
|
||||
-webkit-transform: scaleY(0.5);
|
||||
@ -753,7 +604,8 @@ export default {
|
||||
color: #ebebe7;
|
||||
-webkit-transform-origin: 0 0;
|
||||
transform-origin: 0 0;
|
||||
-webkit-transform: scaleY(0.5);
|
||||
-webkit-transform:
|
||||
scaleY(0.5);
|
||||
transform: scaleY(0.5);
|
||||
}
|
||||
|
||||
@ -766,7 +618,7 @@ export default {
|
||||
}
|
||||
|
||||
.m-sort {
|
||||
position: relative;
|
||||
position: relative
|
||||
}
|
||||
|
||||
.m-sort image {
|
||||
@ -781,7 +633,7 @@ export default {
|
||||
.m-product-price text {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
margin-left: 6rpx;
|
||||
margin-left: 6rpx
|
||||
}
|
||||
|
||||
.m-tab {
|
||||
@ -798,6 +650,7 @@ export default {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
.u-tuan-label {
|
||||
padding: 5rpx;
|
||||
background-color: $default-skin-bg;
|
||||
@ -830,10 +683,11 @@ export default {
|
||||
top: 0px;
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
overflow: hidden;
|
||||
z-index: 998;
|
||||
z-index: 998
|
||||
}
|
||||
|
||||
.m-product-info {
|
||||
.m-product-info
|
||||
{
|
||||
padding: 20rpx 20rpx;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
@ -1,505 +0,0 @@
|
||||
/**
|
||||
* @fileoverview GeoUtils类提供若干几何算法,用来帮助用户判断点与矩形、
|
||||
* 圆形、多边形线、多边形面的关系,并提供计算折线长度和多边形的面积的公式。
|
||||
* 主入口类是<a href="symbols/BMapLib.GeoUtils.html">GeoUtils</a>,
|
||||
* 基于Baidu Map API 1.2。
|
||||
*
|
||||
* @author Baidu Map Api Group
|
||||
* @version 1.2
|
||||
*/
|
||||
|
||||
//BMapLib.GeoUtils.degreeToRad(Number)
|
||||
//将度转化为弧度
|
||||
|
||||
//BMapLib.GeoUtils.getDistance(Point, Point)
|
||||
//计算两点之间的距离,两点坐标必须为经纬度
|
||||
|
||||
//BMapLib.GeoUtils.getPolygonArea(polygon)
|
||||
//计算多边形面或点数组构建图形的面积,注意:坐标类型只能是经纬度,且不适合计算自相交多边形的面积(封闭的面积)
|
||||
|
||||
//BMapLib.GeoUtils.getPolylineDistance(polyline)
|
||||
//计算折线或者点数组的长度
|
||||
|
||||
//BMapLib.GeoUtils.isPointInCircle(point, circle)
|
||||
//判断点是否在圆形内
|
||||
|
||||
//BMapLib.GeoUtils.isPointInPolygon(point, polygon)
|
||||
//判断点是否多边形内
|
||||
|
||||
//BMapLib.GeoUtils.isPointInRect(point, bounds)
|
||||
//判断点是否在矩形内
|
||||
|
||||
//BMapLib.GeoUtils.isPointOnPolyline(point, polyline)
|
||||
//判断点是否在折线上
|
||||
|
||||
//BMapLib.GeoUtils.radToDegree(Number)
|
||||
//将弧度转化为度
|
||||
|
||||
function getCenterPoint(path)
|
||||
{
|
||||
//var path = e.;//Array<Point> 返回多边型的点数组
|
||||
//var ret=parseFloat(num1)+parseFloat(num2);
|
||||
var x = 0.0;
|
||||
var y = 0.0;
|
||||
for(var i=0;i<path.length;i++){
|
||||
x=x+ parseFloat(path[i].lng);
|
||||
y=y+ parseFloat(path[i].lat);
|
||||
}
|
||||
x=x/path.length;
|
||||
y=y/path.length;
|
||||
return new BMap.Point(x,y);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @namespace BMap的所有library类均放在BMapLib命名空间下
|
||||
*/
|
||||
var BMapLib = {};
|
||||
(function () {
|
||||
|
||||
/**
|
||||
* 地球半径
|
||||
*/
|
||||
var EARTHRADIUS = 6370996.81;
|
||||
|
||||
/**
|
||||
* @exports GeoUtils as BMapLib.GeoUtils
|
||||
*/
|
||||
var GeoUtils =
|
||||
/**
|
||||
* GeoUtils类,静态类,勿需实例化即可使用
|
||||
* @class GeoUtils类的<b>入口</b>。
|
||||
* 该类提供的都是静态方法,勿需实例化即可使用。
|
||||
*/
|
||||
BMapLib.GeoUtils = function () {
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断点是否在矩形内
|
||||
* @param {Point} point 点对象
|
||||
* @param {Bounds} bounds 矩形边界对象
|
||||
* @returns {Boolean} 点在矩形内返回true,否则返回false
|
||||
*/
|
||||
GeoUtils.isPointInRect = function (point, bounds) {
|
||||
//检查类型是否正确
|
||||
if (!(point instanceof BMap.Point) ||
|
||||
!(bounds instanceof BMap.Bounds)) {
|
||||
return false;
|
||||
}
|
||||
var sw = bounds.getSouthWest(); //西南脚点
|
||||
var ne = bounds.getNorthEast(); //东北脚点
|
||||
return (point.lng >= sw.lng && point.lng <= ne.lng && point.lat >= sw.lat && point.lat <= ne.lat);
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断点是否在圆形内
|
||||
* @param {Point} point 点对象
|
||||
* @param {Circle} circle 圆形对象
|
||||
* @returns {Boolean} 点在圆形内返回true,否则返回false
|
||||
*/
|
||||
GeoUtils.isPointInCircle = function (point, circle) {
|
||||
//检查类型是否正确
|
||||
if (!(point instanceof BMap.Point) ||
|
||||
!(circle instanceof BMap.Circle)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//point与圆心距离小于圆形半径,则点在圆内,否则在圆外
|
||||
var c = circle.getCenter();
|
||||
var r = circle.getRadius();
|
||||
|
||||
var dis = GeoUtils.getDistance(point, c);
|
||||
if (dis <= r) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断点是否在折线上
|
||||
* @param {Point} point 点对象
|
||||
* @param {Polyline} polyline 折线对象
|
||||
* @returns {Boolean} 点在折线上返回true,否则返回false
|
||||
*/
|
||||
GeoUtils.isPointOnPolyline = function (point, polyline) {
|
||||
//检查类型
|
||||
if (!(point instanceof BMap.Point) ||
|
||||
!(polyline instanceof BMap.Polyline)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//首先判断点是否在线的外包矩形内,如果在,则进一步判断,否则返回false
|
||||
var lineBounds = polyline.getBounds();
|
||||
if (!this.isPointInRect(point, lineBounds)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//判断点是否在线段上,设点为Q,线段为P1P2 ,
|
||||
//判断点Q在该线段上的依据是:( Q - P1 ) × ( P2 - P1 ) = 0,且 Q 在以 P1,P2为对角顶点的矩形内
|
||||
var pts = polyline.getPath();
|
||||
for (var i = 0; i < pts.length - 1; i++) {
|
||||
var curPt = pts[i];
|
||||
var nextPt = pts[i + 1];
|
||||
//首先判断point是否在curPt和nextPt之间,即:此判断该点是否在该线段的外包矩形内
|
||||
if (point.lng >= Math.min(curPt.lng, nextPt.lng) && point.lng <= Math.max(curPt.lng, nextPt.lng) &&
|
||||
point.lat >= Math.min(curPt.lat, nextPt.lat) && point.lat <= Math.max(curPt.lat, nextPt.lat)) {
|
||||
//判断点是否在直线上公式
|
||||
var precision = (curPt.lng - point.lng) * (nextPt.lat - point.lat) - (nextPt.lng - point.lng) * (curPt.lat - point.lat);
|
||||
if (precision < 2e-10 && precision > -2e-10) {//实质判断是否接近0
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断点是否多边形内
|
||||
* @param {Point} point 点对象
|
||||
* @param {Polyline} polygon 多边形对象
|
||||
* @returns {Boolean} 点在多边形内返回true,否则返回false
|
||||
*/
|
||||
GeoUtils.isPointInPolygon = function (point, polygon) {
|
||||
//检查类型
|
||||
if (!(point instanceof BMap.Point) ||
|
||||
!(polygon instanceof BMap.Polygon)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
//首先判断点是否在多边形的外包矩形内,如果在,则进一步判断,否则返回false
|
||||
var polygonBounds = polygon.getBounds();
|
||||
if (!this.isPointInRect(point, polygonBounds)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
var pts = polygon.getPath(); //获取多边形点
|
||||
|
||||
//下述代码来源:http://paulbourke.net/geometry/insidepoly/,进行了部分修改
|
||||
//基本思想是利用射线法,计算射线与多边形各边的交点,如果是偶数,则点在多边形外,否则
|
||||
//在多边形内。还会考虑一些特殊情况,如点在多边形顶点上,点在多边形边上等特殊情况。
|
||||
|
||||
var N = pts.length;
|
||||
var boundOrVertex = true; //如果点位于多边形的顶点或边上,也算做点在多边形内,直接返回true
|
||||
var intersectCount = 0; //cross points count of x
|
||||
var precision = 2e-10; //浮点类型计算时候与0比较时候的容差
|
||||
var p1, p2; //neighbour bound vertices
|
||||
var p = point; //测试点
|
||||
|
||||
p1 = pts[0]; //left vertex
|
||||
for (var i = 1; i <= N; ++i) {//check all rays
|
||||
if (p.equals(p1)) {
|
||||
return boundOrVertex; //p is an vertex
|
||||
}
|
||||
|
||||
p2 = pts[i % N]; //right vertex
|
||||
if (p.lat < Math.min(p1.lat, p2.lat) || p.lat > Math.max(p1.lat, p2.lat)) {//ray is outside of our interests
|
||||
p1 = p2;
|
||||
continue; //next ray left point
|
||||
}
|
||||
if (p.lat > Math.min(p1.lat, p2.lat) && p.lat < Math.max(p1.lat, p2.lat)) {//ray is crossing over by the algorithm (common part of)
|
||||
if (p.lng <= Math.max(p1.lng, p2.lng)) {//x is before of ray
|
||||
if (p1.lat == p2.lat && p.lng >= Math.min(p1.lng, p2.lng)) {//overlies on a horizontal ray
|
||||
return boundOrVertex;
|
||||
}
|
||||
|
||||
if (p1.lng == p2.lng) {//ray is vertical
|
||||
|
||||
|
||||
if (p1.lng == p.lng) {//overlies on a vertical ray
|
||||
return boundOrVertex;
|
||||
} else {//before ray
|
||||
++intersectCount;
|
||||
}
|
||||
} else {//cross point on the left side
|
||||
|
||||
|
||||
var xinters = (p.lat - p1.lat) * (p2.lng - p1.lng) / (p2.lat - p1.lat) + p1.lng; //cross point of lng
|
||||
|
||||
|
||||
if (Math.abs(p.lng - xinters) < precision) {//overlies on a ray
|
||||
return boundOrVertex;
|
||||
}
|
||||
|
||||
if (p.lng < xinters) {//before ray
|
||||
++intersectCount;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {//special case when ray is crossing through the vertex
|
||||
if (p.lat == p2.lat && p.lng <= p2.lng) {//p crossing over p2
|
||||
var p3 = pts[(i + 1) % N]; //next vertex
|
||||
|
||||
|
||||
if (p.lat >= Math.min(p1.lat, p3.lat) && p.lat <= Math.max(p1.lat, p3.lat)) {//p.lat lies between p1.lat & p3.lat
|
||||
++intersectCount;
|
||||
} else {
|
||||
intersectCount += 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
p1 = p2; //next ray left point
|
||||
}
|
||||
|
||||
if (intersectCount % 2 == 0) {//偶数在多边形外
|
||||
return false;
|
||||
} else { //奇数在多边形内
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 将度转化为弧度
|
||||
* @param {degree} Number 度
|
||||
* @returns {Number} 弧度
|
||||
*/
|
||||
GeoUtils.degreeToRad = function (degree) {
|
||||
return Math.PI * degree / 180;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将弧度转化为度
|
||||
* @param {radian} Number 弧度
|
||||
* @returns {Number} 度
|
||||
*/
|
||||
GeoUtils.radToDegree = function (rad) {
|
||||
return (180 * rad) / Math.PI;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将v值限定在a,b之间,纬度使用
|
||||
*/
|
||||
function _getRange(v, a, b) {
|
||||
if (a != null) {
|
||||
v = Math.max(v, a);
|
||||
}
|
||||
if (b != null) {
|
||||
v = Math.min(v, b);
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
/**
|
||||
* 将v值限定在a,b之间,经度使用
|
||||
*/
|
||||
function _getLoop(v, a, b) {
|
||||
while (v > b) {
|
||||
v -= b - a
|
||||
}
|
||||
while (v < a) {
|
||||
v += b - a
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算两点之间的距离,两点坐标必须为经纬度
|
||||
* @param {point1} Point 点对象
|
||||
* @param {point2} Point 点对象
|
||||
* @returns {Number} 两点之间距离,单位为米
|
||||
*/
|
||||
GeoUtils.getDistance = function (point1, point2) {
|
||||
//判断类型
|
||||
// debugger;
|
||||
// if (!(point1 instanceof BMap.Point) ||
|
||||
// !(point2 instanceof BMap.Point)) {
|
||||
// return 0;
|
||||
// }
|
||||
|
||||
point1.lng = _getLoop(point1.lng, -180, 180);
|
||||
point1.lat = _getRange(point1.lat, -74, 74);
|
||||
point2.lng = _getLoop(point2.lng, -180, 180);
|
||||
point2.lat = _getRange(point2.lat, -74, 74);
|
||||
|
||||
var x1, x2, y1, y2;
|
||||
x1 = GeoUtils.degreeToRad(point1.lng);
|
||||
y1 = GeoUtils.degreeToRad(point1.lat);
|
||||
x2 = GeoUtils.degreeToRad(point2.lng);
|
||||
y2 = GeoUtils.degreeToRad(point2.lat);
|
||||
|
||||
return EARTHRADIUS * Math.acos((Math.sin(y1) * Math.sin(y2) + Math.cos(y1) * Math.cos(y2) * Math.cos(x2 - x1)));
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算折线或者点数组的长度
|
||||
* @param {Polyline|Array<Point>} polyline 折线对象或者点数组
|
||||
* @returns {Number} 折线或点数组对应的长度
|
||||
*/
|
||||
GeoUtils.getPolylineDistance = function (polyline) {
|
||||
//检查类型
|
||||
if (polyline instanceof BMap.Polyline ||
|
||||
polyline instanceof Array) {
|
||||
//将polyline统一为数组
|
||||
var pts;
|
||||
if (polyline instanceof BMap.Polyline) {
|
||||
pts = polyline.getPath();
|
||||
} else {
|
||||
pts = polyline;
|
||||
}
|
||||
|
||||
if (pts.length < 2) {//小于2个点,返回0
|
||||
return 0;
|
||||
}
|
||||
|
||||
//遍历所有线段将其相加,计算整条线段的长度
|
||||
var totalDis = 0;
|
||||
for (var i = 0; i < pts.length - 1; i++) {
|
||||
var curPt = pts[i];
|
||||
var nextPt = pts[i + 1]
|
||||
var dis = GeoUtils.getDistance(curPt, nextPt);
|
||||
totalDis += dis;
|
||||
}
|
||||
|
||||
return totalDis;
|
||||
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 计算多边形面或点数组构建图形的面积,注意:坐标类型只能是经纬
|
||||
|
||||
度,且不适合计算自相交多边形的面积
|
||||
* @param {Polygon|Array<Point>} polygon 多边形面对象或者点数
|
||||
|
||||
组
|
||||
* @returns {Number} 多边形面或点数组构成图形的面积
|
||||
*/
|
||||
GeoUtils.getPolygonArea = function (polygon) {
|
||||
//检查类型
|
||||
if (!(polygon instanceof BMap.Polygon) &&
|
||||
!(polygon instanceof Array)) {
|
||||
return 0;
|
||||
}
|
||||
var pts;
|
||||
if (polygon instanceof BMap.Polygon) {
|
||||
pts = polygon.getPath();
|
||||
} else {
|
||||
pts = polygon;
|
||||
}
|
||||
|
||||
if (pts.length < 3) {//小于3个顶点,不能构建面
|
||||
return 0;
|
||||
}
|
||||
|
||||
var totalArea = 0; //初始化总面积
|
||||
var LowX = 0.0;
|
||||
var LowY = 0.0;
|
||||
var MiddleX = 0.0;
|
||||
var MiddleY = 0.0;
|
||||
var HighX = 0.0;
|
||||
var HighY = 0.0;
|
||||
var AM = 0.0;
|
||||
var BM = 0.0;
|
||||
var CM = 0.0;
|
||||
var AL = 0.0;
|
||||
var BL = 0.0;
|
||||
var CL = 0.0;
|
||||
var AH = 0.0;
|
||||
var BH = 0.0;
|
||||
var CH = 0.0;
|
||||
var CoefficientL = 0.0;
|
||||
var CoefficientH = 0.0;
|
||||
var ALtangent = 0.0;
|
||||
var BLtangent = 0.0;
|
||||
var CLtangent = 0.0;
|
||||
var AHtangent = 0.0;
|
||||
var BHtangent = 0.0;
|
||||
var CHtangent = 0.0;
|
||||
var ANormalLine = 0.0;
|
||||
var BNormalLine = 0.0;
|
||||
var CNormalLine = 0.0;
|
||||
var OrientationValue = 0.0;
|
||||
var AngleCos = 0.0;
|
||||
var Sum1 = 0.0;
|
||||
var Sum2 = 0.0;
|
||||
var Count2 = 0;
|
||||
var Count1 = 0;
|
||||
var Sum = 0.0;
|
||||
var Radius = EARTHRADIUS; //6378137.0,WGS84椭球半径
|
||||
var Count = pts.length;
|
||||
for (var i = 0; i < Count; i++) {
|
||||
if (i == 0) {
|
||||
LowX = pts[Count - 1].lng * Math.PI / 180;
|
||||
LowY = pts[Count - 1].lat * Math.PI / 180;
|
||||
MiddleX = pts[0].lng * Math.PI / 180;
|
||||
MiddleY = pts[0].lat * Math.PI / 180;
|
||||
HighX = pts[1].lng * Math.PI / 180;
|
||||
HighY = pts[1].lat * Math.PI / 180;
|
||||
}
|
||||
else if (i == Count - 1) {
|
||||
LowX = pts[Count - 2].lng * Math.PI / 180;
|
||||
LowY = pts[Count - 2].lat * Math.PI / 180;
|
||||
MiddleX = pts[Count - 1].lng * Math.PI / 180;
|
||||
MiddleY = pts[Count - 1].lat * Math.PI / 180;
|
||||
HighX = pts[0].lng * Math.PI / 180;
|
||||
HighY = pts[0].lat * Math.PI / 180;
|
||||
}
|
||||
else {
|
||||
LowX = pts[i - 1].lng * Math.PI / 180;
|
||||
LowY = pts[i - 1].lat * Math.PI / 180;
|
||||
MiddleX = pts[i].lng * Math.PI / 180;
|
||||
MiddleY = pts[i].lat * Math.PI / 180;
|
||||
HighX = pts[i + 1].lng * Math.PI / 180;
|
||||
HighY = pts[i + 1].lat * Math.PI / 180;
|
||||
}
|
||||
AM = Math.cos(MiddleY) * Math.cos(MiddleX);
|
||||
BM = Math.cos(MiddleY) * Math.sin(MiddleX);
|
||||
CM = Math.sin(MiddleY);
|
||||
AL = Math.cos(LowY) * Math.cos(LowX);
|
||||
BL = Math.cos(LowY) * Math.sin(LowX);
|
||||
CL = Math.sin(LowY);
|
||||
AH = Math.cos(HighY) * Math.cos(HighX);
|
||||
BH = Math.cos(HighY) * Math.sin(HighX);
|
||||
CH = Math.sin(HighY);
|
||||
CoefficientL = (AM * AM + BM * BM + CM * CM) / (AM * AL + BM * BL + CM * CL);
|
||||
CoefficientH = (AM * AM + BM * BM + CM * CM) / (AM * AH + BM * BH + CM * CH);
|
||||
ALtangent = CoefficientL * AL - AM;
|
||||
BLtangent = CoefficientL * BL - BM;
|
||||
CLtangent = CoefficientL * CL - CM;
|
||||
AHtangent = CoefficientH * AH - AM;
|
||||
BHtangent = CoefficientH * BH - BM;
|
||||
CHtangent = CoefficientH * CH - CM;
|
||||
AngleCos = (AHtangent * ALtangent + BHtangent * BLtangent + CHtangent * CLtangent) / (Math.sqrt(AHtangent * AHtangent + BHtangent * BHtangent + CHtangent * CHtangent) * Math.sqrt(ALtangent * ALtangent + BLtangent * BLtangent + CLtangent * CLtangent));
|
||||
AngleCos = Math.acos(AngleCos);
|
||||
ANormalLine = BHtangent * CLtangent - CHtangent * BLtangent;
|
||||
BNormalLine = 0 - (AHtangent * CLtangent - CHtangent * ALtangent);
|
||||
CNormalLine = AHtangent * BLtangent - BHtangent * ALtangent;
|
||||
if (AM != 0)
|
||||
OrientationValue = ANormalLine / AM;
|
||||
else if (BM != 0)
|
||||
OrientationValue = BNormalLine / BM;
|
||||
else
|
||||
OrientationValue = CNormalLine / CM;
|
||||
if (OrientationValue > 0) {
|
||||
Sum1 += AngleCos;
|
||||
Count1++;
|
||||
}
|
||||
else {
|
||||
Sum2 += AngleCos;
|
||||
Count2++;
|
||||
}
|
||||
}
|
||||
var tempSum1, tempSum2;
|
||||
tempSum1 = Sum1 + (2 * Math.PI * Count2 - Sum2);
|
||||
tempSum2 = (2 * Math.PI * Count1 - Sum1) + Sum2;
|
||||
if (Sum1 > Sum2) {
|
||||
if ((tempSum1 - (Count - 2) * Math.PI) < 1)
|
||||
Sum = tempSum1;
|
||||
else
|
||||
Sum = tempSum2;
|
||||
}
|
||||
else {
|
||||
if ((tempSum2 - (Count - 2) * Math.PI) < 1)
|
||||
Sum = tempSum2;
|
||||
else
|
||||
Sum = tempSum1;
|
||||
}
|
||||
totalArea = (Sum - (Count - 2) * Math.PI) * Radius * Radius;
|
||||
return totalArea; //返回总面积
|
||||
}
|
||||
|
||||
})(); //闭包结束
|
||||
|
||||
export default BMapLib
|
||||
@ -59,7 +59,6 @@
|
||||
document.documentElement.style.fontSize = document.documentElement.clientWidth / 20 + 'px'
|
||||
})
|
||||
</script>
|
||||
|
||||
<link rel="stylesheet" href="<%= htmlWebpackPlugin.options.baseUrl %>static/index.css" />
|
||||
</head>
|
||||
<body>
|
||||
|
||||
455
libs/bmap-wx.js
@ -1,455 +0,0 @@
|
||||
/**
|
||||
* @file 微信小程序JSAPI
|
||||
* @author 崔健 cuijian03@baidu.com 2017.01.10
|
||||
* @update 邓淑芳 623996689@qq.com 2019.07.03
|
||||
*/
|
||||
|
||||
/**
|
||||
* 百度地图微信小程序API类
|
||||
*
|
||||
* @class
|
||||
*/
|
||||
class BMapWX {
|
||||
|
||||
/**
|
||||
* 百度地图微信小程序API类
|
||||
*
|
||||
* @constructor
|
||||
*/
|
||||
constructor(param) {
|
||||
this.ak = param["ak"];
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用微信接口进行定位
|
||||
*
|
||||
* @param {string} type 坐标类型
|
||||
* @param {Function} success 成功执行
|
||||
* @param {Function} fail 失败执行
|
||||
* @param {Function} complete 完成后执行
|
||||
*/
|
||||
getWXLocation(type, success, fail, complete) {
|
||||
type = type || 'gcj02',
|
||||
success = success || function () { };
|
||||
fail = fail || function () { };
|
||||
complete = complete || function () { };
|
||||
wx.getLocation({
|
||||
type: type,
|
||||
success: success,
|
||||
fail: fail,
|
||||
complete: complete
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* POI周边检索
|
||||
*
|
||||
* @param {Object} param 检索配置
|
||||
* 参数对象结构可以参考
|
||||
* http://lbsyun.baidu.com/index.php?title=webapi/guide/webservice-placeapi
|
||||
*/
|
||||
search(param) {
|
||||
var that = this;
|
||||
param = param || {};
|
||||
let searchparam = {
|
||||
query: param["query"] || '生活服务$美食&酒店',
|
||||
scope: param["scope"] || 1,
|
||||
filter: param["filter"] || '',
|
||||
coord_type: param["coord_type"] || 2,
|
||||
page_size: param["page_size"] || 10,
|
||||
page_num: param["page_num"] || 0,
|
||||
output: param["output"] || 'json',
|
||||
ak: that.ak,
|
||||
sn: param["sn"] || '',
|
||||
timestamp: param["timestamp"] || '',
|
||||
radius: param["radius"] || 2000,
|
||||
ret_coordtype: 'gcj02ll'
|
||||
};
|
||||
let otherparam = {
|
||||
iconPath: param["iconPath"],
|
||||
iconTapPath: param["iconTapPath"],
|
||||
width: param["width"],
|
||||
height: param["height"],
|
||||
alpha: param["alpha"] || 1,
|
||||
success: param["success"] || function () { },
|
||||
fail: param["fail"] || function () { }
|
||||
};
|
||||
let type = 'gcj02';
|
||||
let locationsuccess = function (result) {
|
||||
searchparam["location"] = result["latitude"] + ',' + result["longitude"];
|
||||
wx.request({
|
||||
url: 'https://api.map.baidu.com/place/v2/search',
|
||||
data: searchparam,
|
||||
header: {
|
||||
"content-type": "application/json"
|
||||
},
|
||||
method: 'GET',
|
||||
success(data) {
|
||||
let res = data["data"];
|
||||
if (res["status"] === 0) {
|
||||
let poiArr = res["results"];
|
||||
// outputRes 包含两个对象,
|
||||
// originalData为百度接口返回的原始数据
|
||||
// wxMarkerData为小程序规范的marker格式
|
||||
let outputRes = {};
|
||||
outputRes["originalData"] = res;
|
||||
outputRes["wxMarkerData"] = [];
|
||||
for (let i = 0; i < poiArr.length; i++) {
|
||||
outputRes["wxMarkerData"][i] = {
|
||||
id: i,
|
||||
latitude: poiArr[i]["location"]["lat"],
|
||||
longitude: poiArr[i]["location"]["lng"],
|
||||
title: poiArr[i]["name"],
|
||||
iconPath: otherparam["iconPath"],
|
||||
iconTapPath: otherparam["iconTapPath"],
|
||||
address: poiArr[i]["address"],
|
||||
telephone: poiArr[i]["telephone"],
|
||||
alpha: otherparam["alpha"],
|
||||
width: otherparam["width"],
|
||||
height: otherparam["height"]
|
||||
}
|
||||
}
|
||||
otherparam.success(outputRes);
|
||||
} else {
|
||||
otherparam.fail({
|
||||
errMsg: res["message"],
|
||||
statusCode: res["status"]
|
||||
});
|
||||
}
|
||||
},
|
||||
fail(data) {
|
||||
otherparam.fail(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
let locationfail = function (result) {
|
||||
otherparam.fail(result);
|
||||
};
|
||||
let locationcomplete = function (result) {
|
||||
};
|
||||
if (!param["location"]) {
|
||||
that.getWXLocation(type, locationsuccess, locationfail, locationcomplete);
|
||||
} else {
|
||||
let longitude = param.location.split(',')[1];
|
||||
let latitude = param.location.split(',')[0];
|
||||
let errMsg = 'input location';
|
||||
let res = {
|
||||
errMsg: errMsg,
|
||||
latitude: latitude,
|
||||
longitude: longitude
|
||||
};
|
||||
locationsuccess(res);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* sug模糊检索
|
||||
*
|
||||
* @param {Object} param 检索配置
|
||||
* 参数对象结构可以参考
|
||||
* http://lbsyun.baidu.com/index.php?title=webapi/place-suggestion-api
|
||||
*/
|
||||
suggestion(param) {
|
||||
var that = this;
|
||||
param = param || {};
|
||||
let suggestionparam = {
|
||||
query: param["query"] || '',
|
||||
region: param["region"] || '全国',
|
||||
city_limit: param["city_limit"] || false,
|
||||
output: param["output"] || 'json',
|
||||
ak: that.ak,
|
||||
sn: param["sn"] || '',
|
||||
timestamp: param["timestamp"] || '',
|
||||
ret_coordtype: 'gcj02ll'
|
||||
};
|
||||
let otherparam = {
|
||||
success: param["success"] || function () { },
|
||||
fail: param["fail"] || function () { }
|
||||
};
|
||||
wx.request({
|
||||
url: 'https://api.map.baidu.com/place/v2/suggestion',
|
||||
data: suggestionparam,
|
||||
header: {
|
||||
"content-type": "application/json"
|
||||
},
|
||||
method: 'GET',
|
||||
success(data) {
|
||||
let res = data["data"];
|
||||
if (res["status"] === 0) {
|
||||
otherparam.success(res);
|
||||
} else {
|
||||
otherparam.fail({
|
||||
errMsg: res["message"],
|
||||
statusCode: res["status"]
|
||||
});
|
||||
}
|
||||
},
|
||||
fail(data) {
|
||||
otherparam.fail(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* rgc检索(逆地理编码:经纬度->地点描述)
|
||||
*
|
||||
* @param {Object} param 检索配置
|
||||
* 参数对象结构可以参考
|
||||
* https://lbs.baidu.com/index.php?title=webapi/guide/webservice-geocoding-abroad
|
||||
*
|
||||
*/
|
||||
regeocoding (param) {
|
||||
var that = this;
|
||||
param = param || {};
|
||||
let regeocodingparam = {
|
||||
coordtype: param["coordtype"] || 'gcj02ll',
|
||||
ret_coordtype: param['ret_coordtype'] || 'gcj02ll',
|
||||
radius: param["radius"] || 1000,
|
||||
ak: that.ak,
|
||||
sn: param["sn"] || '',
|
||||
output: param["output"] || 'json',
|
||||
callback: param["callback"] || function () { },
|
||||
extensions_poi: param["extensions_poi"] || 1,
|
||||
extensions_road: param["extensions_road"] || false,
|
||||
extensions_town: param["extensions_town"] || false,
|
||||
language: param["language"] || 'zh-CN',
|
||||
language_auto: param["language_auto"] || 0,
|
||||
poi_types:param['poi_types'] || "美食|酒店|购物|休闲娱乐|教育培训|医疗|金融|房地产|政府机构|铁路"
|
||||
};
|
||||
let otherparam = {
|
||||
iconPath: param["iconPath"],
|
||||
iconTapPath: param["iconTapPath"],
|
||||
width: param["width"],
|
||||
height: param["height"],
|
||||
alpha: param["alpha"] || 1,
|
||||
success: param["success"] || function () { },
|
||||
fail: param["fail"] || function () { }
|
||||
};
|
||||
|
||||
|
||||
let type = 'gcj02';
|
||||
let locationsuccess = function (result) {
|
||||
regeocodingparam["location"] = result["latitude"] + ',' + result["longitude"];
|
||||
wx.request({
|
||||
url: 'https://api.map.baidu.com/reverse_geocoding/v3',
|
||||
data: regeocodingparam,
|
||||
header: {
|
||||
"content-type": "application/json"
|
||||
},
|
||||
method: 'GET',
|
||||
success(data) {
|
||||
let res = data["data"];
|
||||
if (res["status"] === 0) {
|
||||
let poiObj = res["result"];
|
||||
// outputRes 包含两个对象:
|
||||
// originalData为百度接口返回的原始数据
|
||||
// wxMarkerData为小程序规范的marker格式
|
||||
let outputRes = {};
|
||||
outputRes["originalData"] = res;
|
||||
outputRes["wxMarkerData"] = [];
|
||||
outputRes["wxMarkerData"][0] = {
|
||||
id: 0,
|
||||
latitude: result["latitude"],
|
||||
longitude: result["longitude"],
|
||||
address: poiObj["formatted_address"],
|
||||
iconPath: otherparam["iconPath"],
|
||||
iconTapPath: otherparam["iconTapPath"],
|
||||
desc: poiObj["sematic_description"],
|
||||
business: poiObj["business"],
|
||||
alpha: otherparam["alpha"],
|
||||
width: otherparam["width"],
|
||||
height: otherparam["height"]
|
||||
}
|
||||
otherparam.success(outputRes);
|
||||
} else {
|
||||
otherparam.fail({
|
||||
errMsg: res["message"],
|
||||
statusCode: res["status"]
|
||||
});
|
||||
}
|
||||
},
|
||||
fail(data) {
|
||||
otherparam.fail(data);
|
||||
}
|
||||
});
|
||||
};
|
||||
let locationfail = function (result) {
|
||||
otherparam.fail(result);
|
||||
}
|
||||
let locationcomplete = function (result) {
|
||||
};
|
||||
if (!param["location"]) {
|
||||
that.getWXLocation(type, locationsuccess, locationfail, locationcomplete);
|
||||
} else {
|
||||
let longitude = param.location.split(',')[1];
|
||||
let latitude = param.location.split(',')[0];
|
||||
let errMsg = 'input location';
|
||||
let res = {
|
||||
errMsg: errMsg,
|
||||
latitude: latitude,
|
||||
longitude: longitude
|
||||
};
|
||||
locationsuccess(res);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gc检索(地理编码:地点->经纬度)
|
||||
*
|
||||
* @param {Object} param 检索配置
|
||||
* 参数对象结构可以参考
|
||||
* https://lbs.baidu.com/index.php?title=webapi/guide/webservice-geocoding
|
||||
*
|
||||
*/
|
||||
geocoding(param) {
|
||||
var that = this;
|
||||
param = param || {};
|
||||
let geocodingparam = {
|
||||
address: param["address"] || '',
|
||||
city: param["city"] || '',
|
||||
ret_coordtype: param["coordtype"] || 'gcj02ll',
|
||||
ak: that.ak,
|
||||
sn: param["sn"] || '',
|
||||
output: param["output"] || 'json',
|
||||
callback: param["callback"] || function () { }
|
||||
};
|
||||
let otherparam = {
|
||||
iconPath: param["iconPath"],
|
||||
iconTapPath: param["iconTapPath"],
|
||||
width: param["width"],
|
||||
height: param["height"],
|
||||
alpha: param["alpha"] || 1,
|
||||
success: param["success"] || function () { },
|
||||
fail: param["fail"] || function () { }
|
||||
};
|
||||
if (param["address"]) {
|
||||
wx.request({
|
||||
url: 'https://api.map.baidu.com/geocoding/v3',
|
||||
data: geocodingparam,
|
||||
header: {
|
||||
"content-type": "application/json"
|
||||
},
|
||||
method: 'GET',
|
||||
success(data) {
|
||||
let res = data["data"];
|
||||
if (res["status"] === 0){
|
||||
let poiObj = res["result"];
|
||||
// outputRes 包含两个对象:
|
||||
// originalData为百度接口返回的原始数据
|
||||
// wxMarkerData为小程序规范的marker格式
|
||||
let outputRes = res;
|
||||
outputRes["originalData"] = res;
|
||||
outputRes["wxMarkerData"] = [];
|
||||
outputRes["wxMarkerData"][0] = {
|
||||
id: 0,
|
||||
latitude: poiObj["location"]["lat"],
|
||||
longitude: poiObj["location"]["lng"],
|
||||
iconPath: otherparam["iconPath"],
|
||||
iconTapPath: otherparam["iconTapPath"],
|
||||
alpha: otherparam["alpha"],
|
||||
width: otherparam["width"],
|
||||
height: otherparam["height"]
|
||||
}
|
||||
otherparam.success(outputRes);
|
||||
} else {
|
||||
otherparam.fail({
|
||||
errMsg: res["message"],
|
||||
statusCode: res["status"]
|
||||
});
|
||||
}
|
||||
},
|
||||
fail(data) {
|
||||
otherparam.fail(data);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
let errMsg = 'input address!';
|
||||
let res = {
|
||||
errMsg: errMsg
|
||||
};
|
||||
otherparam.fail(res);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 天气检索
|
||||
*
|
||||
* @param {Object} param 检索配置
|
||||
*/
|
||||
weather(param) {
|
||||
var that = this;
|
||||
param = param || {};
|
||||
let weatherparam = {
|
||||
coord_type: param["coord_type"] || 'gcj02',
|
||||
output: param["output"] || 'json',
|
||||
ak: that.ak,
|
||||
sn: param["sn"] || '',
|
||||
timestamp: param["timestamp"] || ''
|
||||
};
|
||||
let otherparam = {
|
||||
success: param["success"] || function () { },
|
||||
fail: param["fail"] || function () { }
|
||||
};
|
||||
let type = 'gcj02';
|
||||
let locationsuccess = function (result) {
|
||||
weatherparam["location"] = result["longitude"] + ',' + result["latitude"];
|
||||
wx.request({
|
||||
url: 'https://api.map.baidu.com/telematics/v3/weather',
|
||||
data: weatherparam,
|
||||
header: {
|
||||
"content-type": "application/json"
|
||||
},
|
||||
method: 'GET',
|
||||
success(data) {
|
||||
let res = data["data"];
|
||||
if (res["error"] === 0 && res["status"] === 'success') {
|
||||
let weatherArr = res["results"];
|
||||
// outputRes 包含两个对象,
|
||||
// originalData为百度接口返回的原始数据
|
||||
// wxMarkerData为小程序规范的marker格式
|
||||
let outputRes = {};
|
||||
outputRes["originalData"] = res;
|
||||
outputRes["currentWeather"] = [];
|
||||
outputRes["currentWeather"][0] = {
|
||||
currentCity: weatherArr[0]["currentCity"],
|
||||
pm25: weatherArr[0]["pm25"],
|
||||
date: weatherArr[0]["weather_data"][0]["date"],
|
||||
temperature: weatherArr[0]["weather_data"][0]["temperature"],
|
||||
weatherDesc: weatherArr[0]["weather_data"][0]["weather"],
|
||||
wind: weatherArr[0]["weather_data"][0]["wind"]
|
||||
};
|
||||
otherparam.success(outputRes);
|
||||
} else {
|
||||
otherparam.fail({
|
||||
errMsg: res["message"],
|
||||
statusCode: res["status"]
|
||||
});
|
||||
}
|
||||
},
|
||||
fail(data) {
|
||||
otherparam.fail(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
let locationfail = function (result) {
|
||||
otherparam.fail(result);
|
||||
}
|
||||
let locationcomplete = function (result) {
|
||||
}
|
||||
if (!param["location"]) {
|
||||
that.getWXLocation(type, locationsuccess, locationfail, locationcomplete);
|
||||
} else {
|
||||
let longitude = param.location.split(',')[0];
|
||||
let latitude = param.location.split(',')[1];
|
||||
let errMsg = 'input location';
|
||||
let res = {
|
||||
errMsg: errMsg,
|
||||
latitude: latitude,
|
||||
longitude: longitude
|
||||
};
|
||||
locationsuccess(res);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.BMapWX = BMapWX;
|
||||
@ -238,7 +238,6 @@
|
||||
"mp-weixin" : {
|
||||
/* 小程序特有相关 */
|
||||
"usingComponents" : true,
|
||||
"requiredPrivateInfos" : [ "getLocation", "chooseLocation" ], //开启定位权限
|
||||
"appid" : "wx5a73f844dac0da5c",
|
||||
"setting" : {
|
||||
"urlCheck" : false,
|
||||
@ -283,13 +282,6 @@
|
||||
},
|
||||
"devServer" : {
|
||||
"port" : 12000
|
||||
},
|
||||
"sdkConfigs" : {
|
||||
"maps" : {
|
||||
"bmap" : {
|
||||
"key" : "xSeK5okwxCQbcwdGoOufv2EMuMdvsVFI"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"mp-baidu" : {
|
||||
|
||||
@ -1,41 +1,7 @@
|
||||
<template>
|
||||
<view class="page member-addrsss-list-container">
|
||||
<view v-if="isdata" class="m-ad-list">
|
||||
<view
|
||||
class="list-item"
|
||||
v-for="(item, index) of addresslist"
|
||||
:key="index"
|
||||
@tap="SelectAddress(item)"
|
||||
>
|
||||
<view class="item-left">
|
||||
<view class="item-info">
|
||||
<text
|
||||
:class="['item-lable', lableCalss(item.ud_label)]"
|
||||
v-if="
|
||||
item.ud_label == 1 || item.ud_label == 2 || item.ud_label == 3
|
||||
"
|
||||
>{{ labelList[item.ud_label] }}</text
|
||||
>
|
||||
<text class="item-address">{{ item.ud_marker }}</text>
|
||||
<text class="item-detailed-address">{{ item.ud_street_no }}</text>
|
||||
</view>
|
||||
<view class="item-role-info">
|
||||
<text class="item-name">{{ item.ud_name }}</text>
|
||||
<text class="item-sex">{{
|
||||
item.ud_gender == 1 ? "先生" : "女士"
|
||||
}}</text>
|
||||
<text class="item-mobile">{{ item.ud_mobile }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="item-right">
|
||||
<label
|
||||
:data-ud_id="item.ud_id"
|
||||
@click.stop="EditAddress"
|
||||
class="iconfont icon-edit"
|
||||
></label>
|
||||
</view>
|
||||
</view>
|
||||
<!-- <view v-for="(item, i) in addresslist" :key="i" class="m-ad-item" :data-id="(item.ud_id)" :data-ud_id="(item.ud_id)" @longpress="modify">
|
||||
<view class="page">
|
||||
<view v-if="(isdata)" class="m-ad-list">
|
||||
<view v-for="(item, i) in addresslist" :key="i" class="m-ad-item" :data-id="(item.ud_id)" :data-ud_id="(item.ud_id)" @longpress="modify">
|
||||
<view class="m-ad-l" :data-sel="ud_id" :data-ud_id="(item.ud_id)" :data-address="(item.ud_address)" @tap="SelectAddress">
|
||||
<view class="m-ad-i-top">
|
||||
<text>{{item.ud_name}}</text><label>({{item.ud_intl}}){{item.ud_mobile}}</label>
|
||||
@ -49,21 +15,17 @@
|
||||
<label class="iconfont icon-delete" :data-ud_id="(item.ud_id)" @click="DelAddress"></label>
|
||||
</view>
|
||||
</view>
|
||||
<button class="u-btn u-btn-default" @click="AddAddress" style="margin-top:50rpx;">{{__('添加地址')}}</button> -->
|
||||
<button class="u-btn u-btn-default" @click="AddAddress" style="margin-top:50rpx;">{{__('添加地址')}}</button>
|
||||
</view>
|
||||
<view class="m-nullpage" v-else @click="AddAddress">
|
||||
<view class="m-nullpage-middle">
|
||||
<label class="iconfont icon-dizhi"></label>
|
||||
<view class="m-null-tip">
|
||||
<text>您还没有添加收货地址哦!</text>
|
||||
<text class="m-null-tipck">{{ __("马上去添加地址") }}</text>
|
||||
<text>{{__('想把你的宝贝寄到哪去')}}</text>
|
||||
<text class="m-null-tipck">{{__('马上去添加地址')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="u-btn u-btn-default" @click="AddAddress" v-if="isdata">
|
||||
<text class="iconfontAili icon-zengjiatianjiajiahao"></text>
|
||||
<text>新增收货地址</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@ -71,118 +33,6 @@
|
||||
<style lang="scss">
|
||||
@import "../../styles/_variables";
|
||||
|
||||
.member-addrsss-list-container {
|
||||
background: #fff;
|
||||
overflow: hidden;
|
||||
|
||||
.m-nullpage-middle {
|
||||
height: 100vh;
|
||||
}
|
||||
|
||||
.m-ad-list {
|
||||
background: #fff;
|
||||
height: calc(100vh - 106px);
|
||||
|
||||
/* #ifdef MP-WEIXIN */
|
||||
height: calc(100vh - 120rpx);
|
||||
/* #endif */
|
||||
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.icon-zengjiatianjiajiahao {
|
||||
font-size: 40rpx;
|
||||
color: #3579ff;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin: 0 32rpx;
|
||||
padding: 20rpx 0;
|
||||
border-bottom: 2rpx solid #f0f0f0;
|
||||
|
||||
.item-lable {
|
||||
display: inline-block;
|
||||
margin-right: 9px;
|
||||
padding: 0px 8px;
|
||||
width: 32px;
|
||||
border-radius: 4px;
|
||||
text-align: center;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.item-lable-1 {
|
||||
background: #fdf3da;
|
||||
color: #de8a48;
|
||||
}
|
||||
|
||||
.item-lable-2 {
|
||||
background: #e5eefb;
|
||||
color: #4687e4;
|
||||
}
|
||||
|
||||
.item-lable-3 {
|
||||
background: #eff9e7;
|
||||
color: #6eb768;
|
||||
}
|
||||
|
||||
.item-left {
|
||||
max-width: 86%;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
|
||||
.icon-edit {
|
||||
font-size: 44rpx;
|
||||
color: #848484;
|
||||
}
|
||||
|
||||
.item-address {
|
||||
margin-right: 8rpx;
|
||||
font-weight: 700;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.item-detailed-address {
|
||||
font-weight: 700;
|
||||
font-size: 30rpx;
|
||||
}
|
||||
|
||||
.item-role-info {
|
||||
color: #848484;
|
||||
font-size: 24rpx;
|
||||
|
||||
.item-name {
|
||||
padding-right: 20rpx;
|
||||
}
|
||||
|
||||
.item-mobile {
|
||||
margin-left: 40rpx;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.u-btn-default {
|
||||
position: fixed;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%;
|
||||
background: #fff;
|
||||
color: #000;
|
||||
z-index: 1;
|
||||
margin: 0;
|
||||
height: 120rpx;
|
||||
line-height: 120rpx;
|
||||
bottom: constant(safe-area-inset-bottom);
|
||||
// bottom: env(safe-area-inset-bottom);
|
||||
}
|
||||
}
|
||||
|
||||
.m-ad-item:after {
|
||||
content: " ";
|
||||
position: absolute;
|
||||
@ -224,6 +74,7 @@
|
||||
margin-top: 10rpx;
|
||||
}
|
||||
|
||||
|
||||
.m-ad-icon {
|
||||
font-size: 12px;
|
||||
padding: 4rpx 8rpx;
|
||||
@ -254,10 +105,16 @@
|
||||
text-align: center;
|
||||
color: #888888;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import { mapState, mapMutations } from "vuex";
|
||||
|
||||
import {
|
||||
mapState,
|
||||
mapMutations
|
||||
} from 'vuex'
|
||||
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -266,41 +123,32 @@ export default {
|
||||
addresslist: [],
|
||||
isdata: false,
|
||||
spid: "",
|
||||
ud_id: 0,
|
||||
labelList: ["", "家", "公司", "学校"],
|
||||
};
|
||||
ud_id: 0
|
||||
}
|
||||
},
|
||||
computed: mapState([
|
||||
"Config",
|
||||
"StateCode",
|
||||
"notice",
|
||||
"plantformInfo",
|
||||
"shopInfo",
|
||||
"userInfo",
|
||||
"hasLogin",
|
||||
]),
|
||||
computed: mapState(['Config', 'StateCode', 'notice', 'plantformInfo', 'shopInfo', 'userInfo', 'hasLogin']),
|
||||
onLoad: function(options) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.__("地址列表"),
|
||||
title:this.__('地址列表')
|
||||
});
|
||||
|
||||
this.setData({
|
||||
ud_id: options.ud_id || 0,
|
||||
spid: options.spid || "",
|
||||
options: options,
|
||||
isdata: false,
|
||||
isdata: false
|
||||
});
|
||||
|
||||
var that = this;
|
||||
this.GetAddressList();
|
||||
|
||||
that.notice.addNotification("RefreshAddress", that.RefreshMethod, that);
|
||||
},
|
||||
onShow: function() {
|
||||
this.GetAddressList();
|
||||
},
|
||||
onUnload: function() {
|
||||
// 离开页面,注销事件
|
||||
var that = this;
|
||||
var that = this
|
||||
this.notice.removeNotification("RefreshAddress", that);
|
||||
},
|
||||
/**
|
||||
@ -310,29 +158,10 @@ export default {
|
||||
this.GetAddressList();
|
||||
},
|
||||
methods: {
|
||||
...mapMutations([
|
||||
"login",
|
||||
"logout",
|
||||
"getPlantformInfo",
|
||||
"forceUserInfo",
|
||||
"getUserInfo",
|
||||
]),
|
||||
lableCalss(number) {
|
||||
if (number == 1) {
|
||||
return "item-lable-1";
|
||||
}
|
||||
|
||||
if (number == 2) {
|
||||
return "item-lable-2";
|
||||
}
|
||||
|
||||
if (number == 3) {
|
||||
return "item-lable-3";
|
||||
}
|
||||
},
|
||||
...mapMutations(['login', 'logout', 'getPlantformInfo', 'forceUserInfo', 'getUserInfo']),
|
||||
RefreshMethod: function() {
|
||||
//console.info('.........RefreshMethod');
|
||||
this.GetAddressList();
|
||||
this.GetAddressList()
|
||||
},
|
||||
GetAddressList: function() {
|
||||
var that = this;
|
||||
@ -340,7 +169,7 @@ export default {
|
||||
|
||||
that.setData({
|
||||
isdata: false,
|
||||
addresslist: [],
|
||||
addresslist: []
|
||||
});
|
||||
|
||||
that.$.request({
|
||||
@ -349,60 +178,57 @@ export default {
|
||||
success: function(data, status, msg, code) {
|
||||
if (200 == status) {
|
||||
if (data.items.length > 0) {
|
||||
|
||||
//that.addresslist = data.items;
|
||||
|
||||
that.setData({
|
||||
isdata: true,
|
||||
addresslist: data.items,
|
||||
addresslist: data.items
|
||||
});
|
||||
|
||||
} else {
|
||||
that.setData({
|
||||
isdata: false,
|
||||
isdata: false
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
uni.stopPullDownRefresh();
|
||||
},
|
||||
uni.stopPullDownRefresh()
|
||||
}
|
||||
});
|
||||
},
|
||||
modify: function(e) {
|
||||
var that = this;
|
||||
e.currentTarget.dataset.ud_id;
|
||||
|
||||
let itemList = [that.__("编辑"), that.__("删除")];
|
||||
let itemList = [that.__('编辑'), that.__('删除')]
|
||||
|
||||
uni.showActionSheet({
|
||||
itemList: itemList,
|
||||
success: (res) => {
|
||||
if (res.tapIndex == 0) {
|
||||
if (res.tapIndex == 0)
|
||||
{
|
||||
that.EditAddress(e);
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
that.DelAddress(e);
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
});
|
||||
},
|
||||
SelectAddress: function (item) {
|
||||
// if (obj.currentTarget.dataset.sel) {
|
||||
// var that = this;
|
||||
// var options = that.options;
|
||||
// options.ud_id = obj.currentTarget.dataset.ud_id;
|
||||
// options.address = obj.currentTarget.dataset.address;
|
||||
// that.$.navigateBack(1, function () {
|
||||
// //console.info('SelectAddress')
|
||||
// that.notice.postNotificationName("RefreshOrder", options);
|
||||
// });
|
||||
// }
|
||||
if (item) {
|
||||
SelectAddress: function(obj) {
|
||||
if (obj.currentTarget.dataset.sel)
|
||||
{
|
||||
var that = this;
|
||||
var options = that.options;
|
||||
options.ud_id = item.ud_id;
|
||||
options.address = item.ud_address;
|
||||
options.ud_id = obj.currentTarget.dataset.ud_id;
|
||||
options.address = obj.currentTarget.dataset.address;
|
||||
that.$.navigateBack(1, function() {
|
||||
//console.info('SelectAddress')
|
||||
that.notice.postNotificationName("RefreshOrder", options);
|
||||
});
|
||||
that.notice.postNotificationName("RefreshOrder", options)
|
||||
})
|
||||
}
|
||||
},
|
||||
EditAddress: function(obj) {
|
||||
@ -412,11 +238,11 @@ export default {
|
||||
|
||||
if (that.ud_id != 0) {
|
||||
that.$.redirectTo({
|
||||
url: that.$.createUrl("/member/address/manage", options),
|
||||
url: that.$.createUrl("/member/address/manage", options)
|
||||
});
|
||||
} else {
|
||||
that.$.navigateTo({
|
||||
url: that.$.createUrl("/member/address/manage", options),
|
||||
url: that.$.createUrl("/member/address/manage", options)
|
||||
});
|
||||
}
|
||||
},
|
||||
@ -425,19 +251,22 @@ export default {
|
||||
var that = this;
|
||||
//var options = that.options;
|
||||
|
||||
if (that.options.issub) {
|
||||
if (that.options.issub)
|
||||
{
|
||||
var options = { issub: 1 };
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
var options = {};
|
||||
}
|
||||
|
||||
if (that.ud_id != 0) {
|
||||
that.$.redirectTo({
|
||||
url: that.$.createUrl("/member/address/manage", options),
|
||||
url: that.$.createUrl("/member/address/manage", options)
|
||||
});
|
||||
} else {
|
||||
that.$.navigateTo({
|
||||
url: that.$.createUrl("/member/address/manage", options),
|
||||
url: that.$.createUrl("/member/address/manage", options)
|
||||
});
|
||||
}
|
||||
},
|
||||
@ -451,7 +280,7 @@ export default {
|
||||
success: function(n) {
|
||||
if (n.confirm) {
|
||||
var params = {
|
||||
ud_id: e.currentTarget.dataset.ud_id,
|
||||
ud_id: e.currentTarget.dataset.ud_id
|
||||
};
|
||||
that.$.request({
|
||||
url: that.Config.URL.user.address_remove,
|
||||
@ -459,18 +288,18 @@ export default {
|
||||
success: function(data, status, msg, code) {
|
||||
if (200 == status) {
|
||||
that.$.showToast({
|
||||
title: that.__("删除成功!"),
|
||||
title: that.__("删除成功!")
|
||||
});
|
||||
|
||||
that.notice.postNotificationName("RefreshOrder", 0);
|
||||
that.GetAddressList();
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
},
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
Before Width: | Height: | Size: 7.3 KiB |
|
Before Width: | Height: | Size: 639 B |
@ -1,130 +0,0 @@
|
||||
<template>
|
||||
<view
|
||||
class="u-mask"
|
||||
hover-stop-propagation
|
||||
:style="[maskStyle, zoomStyle]"
|
||||
@tap="click"
|
||||
@touchmove.stop.prevent="() => {}"
|
||||
:class="{
|
||||
'u-mask-zoom': zoom,
|
||||
'u-mask-show': show,
|
||||
}"
|
||||
>
|
||||
<slot />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* mask 遮罩
|
||||
* @description 创建一个遮罩层,用于强调特定的页面元素,并阻止用户对遮罩下层的内容进行操作,一般用于弹窗场景
|
||||
* @tutorial https://www.uviewui.com/components/mask.html
|
||||
* @property {Boolean} show 是否显示遮罩(默认false)
|
||||
* @property {String Number} z-index z-index 层级(默认1070)
|
||||
* @property {Object} custom-style 自定义样式对象,见上方说明
|
||||
* @property {String Number} duration 动画时长,单位毫秒(默认300)
|
||||
* @property {Boolean} zoom 是否使用scale对遮罩进行缩放(默认true)
|
||||
* @property {Boolean} mask-click-able 遮罩是否可点击,为false时点击不会发送click事件(默认true)
|
||||
* @event {Function} click mask-click-able为true时,点击遮罩发送此事件
|
||||
* @example <u-mask :show="show" @click="show = false"></u-mask>
|
||||
*/
|
||||
export default {
|
||||
name: "u-mask",
|
||||
props: {
|
||||
// 是否显示遮罩
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
// 层级z-index
|
||||
zIndex: {
|
||||
type: [Number, String],
|
||||
default: "",
|
||||
},
|
||||
// 用户自定义样式
|
||||
customStyle: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {};
|
||||
},
|
||||
},
|
||||
// 遮罩的动画样式, 是否使用使用zoom进行scale进行缩放
|
||||
zoom: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
// 遮罩的过渡时间,单位为ms
|
||||
duration: {
|
||||
type: [Number, String],
|
||||
default: 300,
|
||||
},
|
||||
// 是否可以通过点击遮罩进行关闭
|
||||
maskClickAble: {
|
||||
type: Boolean,
|
||||
default: true,
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
zoomStyle: {
|
||||
transform: "",
|
||||
},
|
||||
scale: "scale(1.2, 1.2)",
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
show(n) {
|
||||
if (n && this.zoom) {
|
||||
// 当展示遮罩的时候,设置scale为1,达到缩小(原来为1.2)的效果
|
||||
this.zoomStyle.transform = "scale(1, 1)";
|
||||
} else if (!n && this.zoom) {
|
||||
// 当隐藏遮罩的时候,设置scale为1.2,达到放大(因为显示遮罩时已重置为1)的效果
|
||||
this.zoomStyle.transform = this.scale;
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
maskStyle() {
|
||||
let style = {};
|
||||
style.backgroundColor = "rgba(0, 0, 0, 0.6)";
|
||||
if (this.show)
|
||||
style.zIndex = this.zIndex ? this.zIndex : this.$u.zIndex.mask;
|
||||
else style.zIndex = -1;
|
||||
style.transition = `all ${this.duration / 1000}s ease-in-out`;
|
||||
// 判断用户传递的对象是否为空,不为空就进行合并
|
||||
if (Object.keys(this.customStyle).length)
|
||||
style = {
|
||||
...style,
|
||||
...this.customStyle,
|
||||
};
|
||||
return style;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
click() {
|
||||
if (!this.maskClickAble) return;
|
||||
this.$emit("click");
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.u-mask {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
opacity: 0;
|
||||
transition: transform 0.3s;
|
||||
}
|
||||
|
||||
.u-mask-show {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.u-mask-zoom {
|
||||
transform: scale(1.2, 1.2);
|
||||
}
|
||||
</style>
|
||||
@ -1,48 +1,22 @@
|
||||
<template>
|
||||
<scroll-view
|
||||
@scrolltolower="scrollbottom"
|
||||
class="m-orderlist"
|
||||
scroll-y="true"
|
||||
v-if="message_rows.length > 0"
|
||||
>
|
||||
<scroll-view @scrolltolower="scrollbottom" class="m-orderlist" scroll-y="true" v-if="message_rows.length >0">
|
||||
<view class="m-panel-bd">
|
||||
<view class="m-media-box m-media-box-small-appmsg">
|
||||
<view class="m-cells">
|
||||
<block v-for="(item, idx) in message_rows" :key="idx">
|
||||
<view
|
||||
:class="[
|
||||
'm-cell',
|
||||
'm-cell-access',
|
||||
item.message_is_read ? '' : 'active',
|
||||
]"
|
||||
style="padding: 38rpx 30rpx; color: #747474"
|
||||
@click="showMsgDetail(item.message_id)"
|
||||
>
|
||||
<view :class="['m-cell','m-cell-access', item.message_is_read?'':'active']" style='padding:38rpx 30rpx;color:#747474' @click="showMsgDetail(item.message_id)">
|
||||
<view class="m-cell-hd " style="color:#44afa4">
|
||||
<view class="commodity_shopImg">
|
||||
<image
|
||||
class="commodity_shopImg"
|
||||
:src="item.user_other_avatar"
|
||||
></image>
|
||||
<view class='commodity_shopImg'>
|
||||
<image class='commodity_shopImg' :src='item.user_other_avatar'></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="m-cell-bd m-cell-primary">
|
||||
<p style="font-size: 24rpx;padding-left:30rpx">
|
||||
<label
|
||||
style="color: #007aff; padding-right: 10rpx"
|
||||
v-if="!item.message_is_read"
|
||||
>{{ __("未读") }}</label
|
||||
>
|
||||
<label style="color: #007aff; padding-right: 10rpx">{{
|
||||
item.message_time_str
|
||||
}}</label>
|
||||
<u-parse
|
||||
:content="item.message_content + ''"
|
||||
:imageProp="{ lazyLoad: true }"
|
||||
></u-parse>
|
||||
<label style="color:#007AFF;padding-right:10rpx" v-if="!item.message_is_read">{{__('未读')}}</label> <label style="color:#007AFF;padding-right:10rpx">{{item.message_time_str}}</label>
|
||||
<u-parse :content="item.message_content + ''" :imageProp="{lazyLoad:true}"></u-parse>
|
||||
</p>
|
||||
</view>
|
||||
<span class="qkk hide">{{ __("去看看") }}</span>
|
||||
<span class="qkk hide">{{__('去看看')}}</span>
|
||||
<text class="m-cell-ft hide"></text>
|
||||
</view>
|
||||
</block>
|
||||
@ -53,7 +27,7 @@
|
||||
<block v-if="ispage">
|
||||
<view class="u-loadmore">
|
||||
<label class="u-loading"></label>
|
||||
<text class="u-loadmore-tips">{{ __("正在加载") }}</text>
|
||||
<text class="u-loadmore-tips">{{__('正在加载')}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text></text>
|
||||
@ -61,9 +35,7 @@
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="u-loadmore u-loadmore-line">
|
||||
<text class="u-loadmore-tips" style="background-color: #fff">{{
|
||||
__("已经没有了")
|
||||
}}</text>
|
||||
<text class="u-loadmore-tips" style='background-color: #fff'>{{__('已经没有了')}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
@ -71,7 +43,7 @@
|
||||
<view class="m-nullpage" v-else>
|
||||
<view class="m-nullpage-middle">
|
||||
<view class="m-null-tip">
|
||||
<text>{{ __("没有社区相关消息") }}</text>
|
||||
<text>{{__('没有社区相关消息')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -79,84 +51,72 @@
|
||||
|
||||
<script>
|
||||
import dateUtil from "../../helpers/util_date";
|
||||
import uParse from "@/components/u-parse/u-parse.vue";
|
||||
import uParse from '@/components/u-parse/u-parse.vue'
|
||||
|
||||
import { mapState, mapMutations } from "vuex";
|
||||
import {
|
||||
mapState,
|
||||
mapMutations
|
||||
} from 'vuex'
|
||||
|
||||
export default {
|
||||
components: {
|
||||
uParse,
|
||||
uParse
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
message_rows: [],
|
||||
page: 1,
|
||||
ispage: false,
|
||||
flag: false,
|
||||
};
|
||||
flag: false
|
||||
}
|
||||
},
|
||||
computed: mapState([
|
||||
"Config",
|
||||
"StateCode",
|
||||
"notice",
|
||||
"plantformInfo",
|
||||
"shopInfo",
|
||||
"userInfo",
|
||||
"hasLogin",
|
||||
]),
|
||||
computed: mapState(['Config', 'StateCode', 'notice', 'plantformInfo', 'shopInfo', 'userInfo', 'hasLogin']),
|
||||
onLoad(options) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.__("消息"),
|
||||
title: this.__('消息')
|
||||
});
|
||||
var that = this;
|
||||
that.getUserMessage();
|
||||
},
|
||||
methods: {
|
||||
...mapMutations([
|
||||
"login",
|
||||
"logout",
|
||||
"getPlantformInfo",
|
||||
"forceUserInfo",
|
||||
"getUserInfo",
|
||||
]),
|
||||
...mapMutations(['login', 'logout', 'getPlantformInfo', 'forceUserInfo', 'getUserInfo']),
|
||||
|
||||
getUserMessage: function() {
|
||||
let that = this;
|
||||
var params = {
|
||||
page: this.page,
|
||||
page: this.page
|
||||
};
|
||||
|
||||
that.$.request({
|
||||
url: this.Config.URL.user.msg_lists,
|
||||
data: params,
|
||||
success: function(data, status, msg, code) {
|
||||
if (data && data.items.length > 0) {
|
||||
if (data.items.length > 0) {
|
||||
for (var r = 0; r < data.items.length; r++) {
|
||||
data.items[r]["message_time_str"] = dateUtil.dateUtils.format(
|
||||
that.$.datetimeFormatter(data.items[r]["message_time"])
|
||||
);
|
||||
data.items[r]['message_time_str'] = dateUtil.dateUtils.format(that.$.datetimeFormatter(data.items[r]['message_time']));
|
||||
}
|
||||
|
||||
if (data.page >= data.total) {
|
||||
that.setData({
|
||||
message_rows: that.message_rows.concat(data.items),
|
||||
flag: false,
|
||||
ispage: false,
|
||||
ispage: false
|
||||
});
|
||||
} else {
|
||||
that.setData({
|
||||
message_rows: that.message_rows.concat(data.items),
|
||||
flag: true,
|
||||
ispage: true,
|
||||
});
|
||||
ispage: true
|
||||
})
|
||||
}
|
||||
|
||||
} else {
|
||||
that.setData({
|
||||
flag: false,
|
||||
ispage: false,
|
||||
});
|
||||
ispage: false
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
@ -164,29 +124,27 @@ export default {
|
||||
if (this.flag && this.ispage) {
|
||||
var e = this;
|
||||
e.setData({
|
||||
flag: false,
|
||||
}),
|
||||
clearTimeout(t);
|
||||
flag: false
|
||||
}), clearTimeout(t);
|
||||
var t = setTimeout(function() {
|
||||
e.setData({
|
||||
page: parseInt(e.page) + 1,
|
||||
}),
|
||||
e.getUserMessage();
|
||||
}, 500);
|
||||
page: parseInt(e.page) + 1
|
||||
}), e.getUserMessage()
|
||||
}, 500)
|
||||
}
|
||||
},
|
||||
showMsgDetail(message_id) {
|
||||
let url = "/member/member/messagedetail?message_id=" + message_id;
|
||||
let url = '/member/member/messagedetail?message_id=' + message_id;
|
||||
|
||||
for (var r = 0; r < this.message_rows.length; r++) {
|
||||
if (message_id == this.message_rows[r]["message_id"]) {
|
||||
this.$set(this.message_rows[r], "message_is_read", 1);
|
||||
if (message_id == this.message_rows[r]['message_id']) {
|
||||
this.$set(this.message_rows[r], 'message_is_read', 1);
|
||||
}
|
||||
}
|
||||
|
||||
uni.navigateTo({
|
||||
url: url,
|
||||
});
|
||||
url: url
|
||||
})
|
||||
},
|
||||
|
||||
preview(src, e) {
|
||||
@ -198,25 +156,27 @@ export default {
|
||||
console.info(e);
|
||||
|
||||
//this.$.gopage(href);
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "../../styles/_variables";
|
||||
@import url("@/components/u-parse/u-parse.css");
|
||||
|
||||
|
||||
|
||||
.qkk {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
color: #999999
|
||||
}
|
||||
|
||||
.commodity_shopImg {
|
||||
width: 70rpx;
|
||||
height: 70rpx;
|
||||
border-radius: 100%;
|
||||
overflow: hidden;
|
||||
overflow: hidden
|
||||
}
|
||||
|
||||
.m-orderlist {
|
||||
|
||||
@ -1,83 +1,36 @@
|
||||
<template>
|
||||
<view class="page">
|
||||
<view :class="show ? 'cover' : ''"></view>
|
||||
<view :class="(show?'cover':'')"></view>
|
||||
<view class="m-product-all">
|
||||
<view class="m-tab">
|
||||
<scroll-view
|
||||
class="m-navbar scroll-view_H"
|
||||
scroll-x
|
||||
style="width: 100%"
|
||||
>
|
||||
<view
|
||||
:class="[
|
||||
'm-navbar-item ellipsis',
|
||||
tapindex == 1 ? 'm-navbar-item-on' : '',
|
||||
]"
|
||||
@click="allOrders"
|
||||
>
|
||||
{{ __("全部订单") }}
|
||||
<scroll-view class="m-navbar scroll-view_H" scroll-x style="width: 100%">
|
||||
<view :class="['m-navbar-item ellipsis', tapindex==1?'m-navbar-item-on':'']" @click="allOrders">
|
||||
{{__('全部订单')}}
|
||||
</view>
|
||||
<view
|
||||
:class="[
|
||||
'm-navbar-item ellipsis',
|
||||
tapindex == 2 ? 'm-navbar-item-on' : '',
|
||||
]"
|
||||
@click="toBePaid"
|
||||
>
|
||||
{{ __("待支付") }}
|
||||
<view :class="['m-navbar-item ellipsis', tapindex==2?'m-navbar-item-on':'']" @click="toBePaid">
|
||||
{{__('待支付')}}
|
||||
</view>
|
||||
<view
|
||||
v-if="!card_kind_id"
|
||||
:class="[
|
||||
'm-navbar-item ellipsis',
|
||||
tapindex == 5 ? 'm-navbar-item-on' : '',
|
||||
]"
|
||||
@click="toBeShipping"
|
||||
>
|
||||
<label v-if="kind_id == 1201">{{ __("待发货") }}</label>
|
||||
<label v-else>{{ __("待服务") }}</label>
|
||||
<view v-if="!card_kind_id" :class="['m-navbar-item ellipsis', tapindex==5?'m-navbar-item-on':'']" @click="toBeShipping">
|
||||
<label v-if="(kind_id==1201)">{{__('待发货')}}</label>
|
||||
<label v-else>{{__('待服务')}}</label>
|
||||
</view>
|
||||
<view
|
||||
:class="[
|
||||
'm-navbar-item ellipsis',
|
||||
tapindex == 3 ? 'm-navbar-item-on' : '',
|
||||
]"
|
||||
@click="receiptOfGoods"
|
||||
>
|
||||
<label v-if="kind_id == 1201">{{ __("待收货") }}</label>
|
||||
<label v-else>{{ __("待确认") }}</label>
|
||||
<view :class="['m-navbar-item ellipsis', tapindex==3?'m-navbar-item-on':'']" @click="receiptOfGoods">
|
||||
<label v-if="(kind_id==1201)">{{__('待收货')}}</label>
|
||||
<label v-else>{{__('待确认')}}</label>
|
||||
</view>
|
||||
<view
|
||||
:class="[
|
||||
'm-navbar-item ellipsis',
|
||||
tapindex == 4 ? 'm-navbar-item-on' : '',
|
||||
]"
|
||||
@click="toBeEvaluated"
|
||||
>
|
||||
<label v-if="kind_id == 1201">{{ __("已完成") }}</label>
|
||||
<label v-else>{{ __("已服务") }}</label>
|
||||
<view :class="['m-navbar-item ellipsis', tapindex==4?'m-navbar-item-on':'']" @click="toBeEvaluated">
|
||||
<label v-if="(kind_id==1201)">{{__('已完成')}}</label>
|
||||
<label v-else>{{__('已服务')}}</label>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
<view v-if="loadComplete">
|
||||
<scroll-view
|
||||
v-if="orderlist.length > 0"
|
||||
scroll-y="true"
|
||||
class="m-orderlist page-container"
|
||||
@scrolltolower="scrollbottom"
|
||||
>
|
||||
<view
|
||||
v-for="(items, i) in orderlist"
|
||||
:key="i"
|
||||
class="m-panel m-panel-access"
|
||||
>
|
||||
<scroll-view v-if="(orderlist.length>0)" scroll-y="true" class="m-orderlist page-container" @scrolltolower="scrollbottom">
|
||||
<view v-for="(items, i) in orderlist" :key="i" class="m-panel m-panel-access">
|
||||
<view class="m-panel-hd">
|
||||
<navigator
|
||||
:url="'/pagesub/index/store?store_id=' + items.store_id"
|
||||
class="m-cell m-cell-access"
|
||||
style=""
|
||||
hover-class="none"
|
||||
>
|
||||
:url="'/pagesub/index/store?store_id=' + (items.store_id)"
|
||||
class="m-cell m-cell-access" style="" hover-class="none">
|
||||
<view class="m-cell-bd m-cell-primary">
|
||||
<p class="m-store-info">
|
||||
{{items.store_name}}
|
||||
@ -85,89 +38,48 @@
|
||||
</view>
|
||||
<text class="m-cell-ft"></text>
|
||||
</navigator>
|
||||
<text v-if="false"
|
||||
>{{ __("订单编号:") }}{{ items.order_id }}</text
|
||||
>
|
||||
<text style="font-size: 20rpx; padding-left: 6rpx" v-if="false">{{
|
||||
items.payment_type_id == StateCode.PAYMENT_TYPE_DELIVER ||
|
||||
items.payment_type_id == StateCode.PAYMENT_TYPE_OFFLINE
|
||||
? __("货到付款")
|
||||
: __("在线支付")
|
||||
}}</text>
|
||||
<text v-if="false">{{__('订单编号:')}}{{items.order_id}}</text>
|
||||
<text style="font-size: 20rpx;padding-left: 6rpx;" v-if="false">{{(items.payment_type_id==StateCode.PAYMENT_TYPE_DELIVER || items.payment_type_id==StateCode.PAYMENT_TYPE_OFFLINE) ? __('货到付款') : __('在线支付')}}</text>
|
||||
<label>{{items.order_state_name}}</label>
|
||||
</view>
|
||||
|
||||
<view class="m-product-list">
|
||||
<navigator
|
||||
:url="'/member/order/detail?on=' + items.order_id"
|
||||
v-for="(item, ii) in items.item"
|
||||
:key="ii"
|
||||
class="m-product-item"
|
||||
>
|
||||
<navigator :url="'/member/order/detail?on=' + (items.order_id)" v-for="(item, ii) in items.item" :key="ii" class="m-product-item">
|
||||
<view class="m-product-img">
|
||||
<image :src="item.order_item_image" mode="aspectFill" />
|
||||
<image :src="(item.order_item_image)" mode="aspectFill" />
|
||||
</view>
|
||||
<view class="m-product-info">
|
||||
<view class="m-product-name">
|
||||
<!-- items.OrderType == 1 拼团 -->
|
||||
<label
|
||||
><text
|
||||
v-if="item.activity_type_name"
|
||||
class="tag tag-orange"
|
||||
>{{ item.activity_type_name }}</text
|
||||
>{{ item.item_name }}</label
|
||||
>
|
||||
<label><text v-if="(item.activity_type_name)" class="tag tag-orange">{{item.activity_type_name}}</text>{{item.item_name}}</label>
|
||||
|
||||
<label
|
||||
class="m-min-name"
|
||||
style="
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 1;
|
||||
"
|
||||
v-if="false"
|
||||
>
|
||||
<label class="m-min-name" style="overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1" v-if="false">
|
||||
{{item.spec_info?item.spec_info:""}}
|
||||
</label>
|
||||
</view>
|
||||
|
||||
<view class="m-product-price">
|
||||
<block v-if="item.order_item_unit_price">
|
||||
<label>{{ __("¥") }}</label
|
||||
>{{ item.order_item_unit_price }}
|
||||
<label>{{__('¥')}}</label>{{item.order_item_unit_price}}
|
||||
</block>
|
||||
|
||||
<block v-if="item.item_unit_points">
|
||||
<label style="margin: auto 10rpx">+</label
|
||||
>{{ item.item_unit_points }}{{ __("积分") }}
|
||||
<label style="margin: auto 10rpx;">+</label>{{item.item_unit_points}}{{__('积分')}}
|
||||
</block>
|
||||
|
||||
<block v-if="item.item_unit_sp">
|
||||
<label style="margin: auto 10rpx">+</label
|
||||
>{{ item.item_unit_sp }}{{ __("众宝") }}
|
||||
<label style="margin: auto 10rpx;">+</label>{{item.item_unit_sp}}{{__('众宝')}}
|
||||
</block>
|
||||
|
||||
<text style="float: right; margin-right: 60rpx"
|
||||
>x{{ item.order_item_quantity }}</text
|
||||
>
|
||||
<text style="float: right;margin-right: 60rpx;">x{{item.order_item_quantity}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
<!-- items.Type==2 ???? -->
|
||||
<view
|
||||
class="m-product-item"
|
||||
v-if="items.Type == 2"
|
||||
style="height: 154rpx"
|
||||
>
|
||||
<view class="m-product-item" v-if="(items.Type==2)" style="height:154rpx">
|
||||
<view class="m-product-img">
|
||||
<image
|
||||
:src="items.store_logo"
|
||||
mode="aspectFill"
|
||||
style="width: 172rpx; height: 172rpx"
|
||||
/>
|
||||
<image :src="(items.store_logo)" mode="aspectFill" style="width:172rpx;height:172rpx" />
|
||||
</view>
|
||||
<view class="m-product-info2" style="padding:20rpx 0">
|
||||
<view class="m-product-name">
|
||||
@ -177,143 +89,46 @@
|
||||
</view>
|
||||
<view class="m-total-info">
|
||||
<view>
|
||||
{{ __("总金额") }}:
|
||||
{{__('总金额')}}:
|
||||
<block v-if="items.order_payment_amount">
|
||||
<text style="">{{ __("¥") }}</text
|
||||
><label class="m-total-price">{{
|
||||
items.order_payment_amount
|
||||
}}</label>
|
||||
<text style="">{{__('¥')}}</text><label class="m-total-price">{{items.order_payment_amount}}</label>
|
||||
</block>
|
||||
</view>
|
||||
<view
|
||||
v-if="
|
||||
items.order_payment_amount !== items.trade_payment_amount &&
|
||||
items.trade_payment_amount > 0
|
||||
"
|
||||
>
|
||||
{{ __("待付款") }}:
|
||||
<view v-if="items.order_payment_amount !== items.trade_payment_amount && items.trade_payment_amount > 0">
|
||||
{{__('待付款')}}:
|
||||
<block v-if="items.order_payment_amount">
|
||||
<text style="">{{ __("¥") }}</text
|
||||
><label class="m-total-price">{{
|
||||
items.trade_payment_amount
|
||||
}}</label>
|
||||
<text style="">{{__('¥')}}</text><label class="m-total-price">{{items.trade_payment_amount}}</label>
|
||||
</block>
|
||||
</view>
|
||||
|
||||
<block v-if="items.order_resource_ext1"></block>
|
||||
<label
|
||||
class="m-total-price"
|
||||
v-if="items.order_resource_ext1"
|
||||
style="margin: auto 10rpx"
|
||||
>
|
||||
+ {{ items.order_resource_ext1 }}{{ __("积分") }}</label
|
||||
>
|
||||
<label
|
||||
class="m-total-price"
|
||||
v-if="items.order_resource_ext2"
|
||||
style="margin: auto 10rpx"
|
||||
>
|
||||
+ {{ items.order_resource_ext2 }}{{ __("众宝") }}</label
|
||||
>
|
||||
<label class="m-total-price" v-if="items.order_resource_ext1" style="margin: auto 10rpx;"> + {{items.order_resource_ext1}}{{__('积分')}}</label>
|
||||
<label class="m-total-price" v-if="items.order_resource_ext2" style="margin: auto 10rpx;"> + {{items.order_resource_ext2}}{{__('众宝')}}</label>
|
||||
</view>
|
||||
<view class="m-total-btn">
|
||||
<form report-submit="true">
|
||||
<button
|
||||
:data-on="items.order_id"
|
||||
:data-order_payment_amount="items.trade_payment_amount"
|
||||
v-if="
|
||||
items.order_is_paid != StateCode.ORDER_PAID_STATE_YES &&
|
||||
items.order_state_id != StateCode.ORDER_STATE_CANCEL
|
||||
"
|
||||
class="u-link-btn"
|
||||
@click="gotopay"
|
||||
formType="submit"
|
||||
>
|
||||
{{ __("去支付") }}
|
||||
</button>
|
||||
<button :data-on="(items.order_id)" :data-order_payment_amount="(items.trade_payment_amount)" v-if="(items.order_is_paid != StateCode.ORDER_PAID_STATE_YES && items.order_state_id!=StateCode.ORDER_STATE_CANCEL)" class="u-link-btn" @click="gotopay" formType="submit">{{__('去支付')}}</button>
|
||||
</form>
|
||||
|
||||
<view
|
||||
:data-on="items.order_id"
|
||||
v-if="items.order_lock_status"
|
||||
class="u-link-btn"
|
||||
>{{ __("退款/退货中...") }}</view
|
||||
>
|
||||
<view :data-on="(items.order_id)" v-if="(items.order_lock_status)" class="u-link-btn">{{__('退款/退货中...')}}</view>
|
||||
|
||||
<navigator
|
||||
:url="'/member/product/comment?od=' + items.order_id"
|
||||
v-if="
|
||||
items.order_buyer_evaluation_status == 0 &&
|
||||
items.order_state_id == StateCode.ORDER_STATE_FINISH
|
||||
"
|
||||
class="u-link-btn"
|
||||
>{{ __("去评价") }}</navigator
|
||||
>
|
||||
<navigator
|
||||
:url="'/member/product/comment?od=' + items.order_id"
|
||||
v-if="items.order_buyer_evaluation_status == 1"
|
||||
class="u-link-btn"
|
||||
>{{ __("查看评价") }}</navigator
|
||||
>
|
||||
<view
|
||||
:data-on="items.order_id"
|
||||
v-if="
|
||||
(items.kind_id == 1202 || items.kind_id == 1203) &&
|
||||
items.order_state_id == StateCode.ORDER_STATE_SHIPPED
|
||||
"
|
||||
class="u-link-btn"
|
||||
@click="writeOrder"
|
||||
>{{ __("确认服务") }}</view
|
||||
>
|
||||
<view
|
||||
:data-on="items.order_id"
|
||||
v-if="items.if_buyer_cancel"
|
||||
class="u-link-btn"
|
||||
@click="cancelOrder"
|
||||
>{{ __("取消订单") }}</view
|
||||
>
|
||||
<view
|
||||
:data-on="items.order_id"
|
||||
v-if="
|
||||
items.kind_id == 1201 &&
|
||||
items.order_state_id == StateCode.ORDER_STATE_SHIPPED
|
||||
"
|
||||
class="u-link-btn"
|
||||
@click="confirmReceipt"
|
||||
>{{ __("确认收货") }}</view
|
||||
>
|
||||
<view
|
||||
:data-on="items.order_id"
|
||||
v-if="
|
||||
items.kind_id == 1201 &&
|
||||
items.order_state_id == StateCode.ORDER_STATE_FINISH
|
||||
"
|
||||
class="u-link-btn"
|
||||
@click="placeAnOrder"
|
||||
>{{ __("再下一单") }}</view
|
||||
>
|
||||
<navigator
|
||||
:url="'/member/order/detail?on=' + items.order_id"
|
||||
class="u-link-btn"
|
||||
>{{ __("查看详情") }}</navigator
|
||||
>
|
||||
|
||||
<navigator :url="'/member/product/comment?od=' + (items.order_id)" v-if="(items.order_buyer_evaluation_status == 0 &&items.order_state_id == StateCode.ORDER_STATE_FINISH)" class="u-link-btn">{{__('去评价')}}</navigator>
|
||||
<navigator :url="'/member/product/comment?od=' + (items.order_id)" v-if="(items.order_buyer_evaluation_status == 1)" class="u-link-btn">{{__('查看评价')}}</navigator>
|
||||
<view :data-on="(items.order_id)" v-if="((items.kind_id==1202 || items.kind_id==1203) && items.order_state_id == StateCode.ORDER_STATE_SHIPPED)" class="u-link-btn" @click="writeOrder">{{__('确认服务')}}</view>
|
||||
<view :data-on="(items.order_id)" v-if="(items.if_buyer_cancel)" class="u-link-btn" @click="cancelOrder">{{__('取消订单')}}</view>
|
||||
<view :data-on="(items.order_id)" v-if="(items.kind_id==1201 && items.order_state_id == StateCode.ORDER_STATE_SHIPPED)" class="u-link-btn" @click="confirmReceipt">{{__('确认收货')}}</view>
|
||||
<view :data-on="(items.order_id)" v-if="(items.kind_id==1201 && items.order_state_id == StateCode.ORDER_STATE_FINISH)" class="u-link-btn" @click="placeAnOrder">{{__('再下一单')}}</view>
|
||||
<navigator :url="'/member/order/detail?on=' + (items.order_id)" class="u-link-btn">{{__('查看详情')}}</navigator>
|
||||
<!-- ????? -->
|
||||
<navigator
|
||||
v-if="items.Type == 2"
|
||||
:url="
|
||||
'../favorableorderdetail/favorableorderdetail?on=' +
|
||||
items.order_id
|
||||
"
|
||||
class="u-link-btn"
|
||||
>{{ __("查看详情") }}</navigator
|
||||
>
|
||||
<navigator v-if="(items.Type==2)" :url="'../favorableorderdetail/favorableorderdetail?on=' + (items.order_id)" class="u-link-btn">{{__('查看详情')}}</navigator>
|
||||
</view>
|
||||
</view>
|
||||
<view class="m-loading-box">
|
||||
<block v-if="ispage">
|
||||
<block v-if="(ispage)">
|
||||
<view class="u-loadmore">
|
||||
<label class="u-loading"></label>
|
||||
<text class="u-loadmore-tips">{{ __("正在加载") }}</text>
|
||||
<text class="u-loadmore-tips">{{__('正在加载')}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<text></text>
|
||||
@ -321,55 +136,40 @@
|
||||
</block>
|
||||
<block v-else>
|
||||
<view class="u-loadmore u-loadmore-line">
|
||||
<text class="u-loadmore-tips">{{
|
||||
__("没有更多数据啦!")
|
||||
}}</text>
|
||||
<text class="u-loadmore-tips">{{__('没有更多数据啦!')}}</text>
|
||||
</view>
|
||||
</block>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<navigator
|
||||
url="/pages/product/list"
|
||||
redirect="true"
|
||||
class="m-nullpage"
|
||||
v-else
|
||||
>
|
||||
<view class="m-nullpage-middle" v-if="!flag">
|
||||
<navigator url="/pages/product/list" redirect="true" class="m-nullpage" v-else>
|
||||
<view class="m-nullpage-middle" v-if="(!flag)">
|
||||
<view class="m-null-tip">
|
||||
<label style="font-size: 32rpx">{{
|
||||
__("亲~您还没有订单哦,")
|
||||
}}</label
|
||||
><label class="highlight-link">{{ __("快去看看吧") }}</label>
|
||||
<label style="font-size:32rpx;">{{__('亲~您还没有订单哦,')}}</label><label class="highlight-link">{{__('快去看看吧')}}</label>
|
||||
</view>
|
||||
</view>
|
||||
</navigator>
|
||||
</view>
|
||||
<view class="alert" v-if="show">
|
||||
<image
|
||||
style="width: 50rpx; height: 50rpx"
|
||||
src="/static/images/true.png"
|
||||
></image>
|
||||
<view class="alert" v-if="(show)">
|
||||
<image style="width:50rpx;height:50rpx" src="/static/images/true.png"></image>
|
||||
<text style="margin-left:20rpx">{{Info}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<payment-box
|
||||
:paymentDataDefault="paymentData"
|
||||
:order_id="order_id"
|
||||
ref="paymentBox"
|
||||
@onCancel="onCancel"
|
||||
@onPaid="onPaid"
|
||||
@onFail="onFail"
|
||||
></payment-box>
|
||||
|
||||
<payment-box :paymentDataDefault="paymentData" :order_id="order_id" ref="paymentBox" @onCancel="onCancel" @onPaid="onPaid" @onFail="onFail"></payment-box>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
|
||||
<script>
|
||||
import paymentBox from "../../components/payment-box.vue";
|
||||
import paymentBox from '../../components/payment-box.vue'
|
||||
|
||||
import {
|
||||
mapState,
|
||||
mapMutations
|
||||
} from 'vuex'
|
||||
|
||||
import { mapState, mapMutations } from "vuex";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -390,22 +190,16 @@ export default {
|
||||
Info: "",
|
||||
order_id: "",
|
||||
paymentData: {},
|
||||
loadComplete: false, // 没有加载数据前不显示的对应内容
|
||||
};
|
||||
loadComplete: false // 没有加载数据前不显示的对应内容
|
||||
}
|
||||
},
|
||||
components: {
|
||||
paymentBox,
|
||||
paymentBox
|
||||
},
|
||||
computed: mapState([
|
||||
"Config",
|
||||
"StateCode",
|
||||
"notice",
|
||||
"plantformInfo",
|
||||
"shopInfo",
|
||||
"userInfo",
|
||||
"hasLogin",
|
||||
]),
|
||||
computed: mapState(['Config', 'StateCode', 'notice', 'plantformInfo', 'shopInfo', 'userInfo', 'hasLogin']),
|
||||
onLoad: function(options) {
|
||||
|
||||
|
||||
this.setData({
|
||||
tapindex: options.sl ? options.sl : 1,
|
||||
page: 1,
|
||||
@ -413,35 +207,35 @@ export default {
|
||||
orderlist: [],
|
||||
type: options.type ? options.type : 0,
|
||||
kind_id: options.kind_id ? options.kind_id : 1201,
|
||||
card_kind_id: options.card_kind_id ? options.card_kind_id : 0,
|
||||
card_kind_id: options.card_kind_id ? options.card_kind_id : 0
|
||||
});
|
||||
|
||||
if (this.kind_id == 1201) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.__("我的订单"),
|
||||
title: this.__('我的订单')
|
||||
});
|
||||
} else if (this.kind_id == 1202) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.__("我的预约"),
|
||||
title: this.__('我的预约')
|
||||
});
|
||||
} else {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.__("优惠券订单"),
|
||||
title: this.__('优惠券订单')
|
||||
});
|
||||
}
|
||||
|
||||
var t = this;
|
||||
this.notice.addNotification("RefreshMessage", t.RefreshMessage, t);
|
||||
this.getOrderlist();
|
||||
this.getOrderlist()
|
||||
},
|
||||
onShow: function() {
|
||||
let that = this;
|
||||
// 刷新评论
|
||||
uni.$on("refreshComment", function (data) {
|
||||
uni.$on('refreshComment', function(data) {
|
||||
let orderlist = that.orderlist;
|
||||
for (var i = 0; i < orderlist.length; i++) {
|
||||
if (orderlist[i].order_id == data) {
|
||||
orderlist[i].order_buyer_evaluation_status = 1;
|
||||
orderlist[i].order_buyer_evaluation_status = 1
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -450,9 +244,10 @@ export default {
|
||||
onUnload: function() {
|
||||
//移除通知
|
||||
// 离开页面,注销事件
|
||||
var that = this;
|
||||
var that = this
|
||||
this.notice.removeNotification("RefreshMessage", that);
|
||||
|
||||
|
||||
if (this.$refs.paymentBox.showBoxView) {
|
||||
this.$refs.paymentBox.cancel();
|
||||
}
|
||||
@ -471,13 +266,7 @@ export default {
|
||||
this.getOrderlist();
|
||||
},
|
||||
methods: {
|
||||
...mapMutations([
|
||||
"login",
|
||||
"logout",
|
||||
"getPlantformInfo",
|
||||
"forceUserInfo",
|
||||
"getUserInfo",
|
||||
]),
|
||||
...mapMutations(['login', 'logout', 'getPlantformInfo', 'forceUserInfo', 'getUserInfo']),
|
||||
RefreshMessage: function(e) {
|
||||
this.setData({
|
||||
tapindex: 1,
|
||||
@ -488,9 +277,8 @@ export default {
|
||||
flag: true,
|
||||
type: 0,
|
||||
kind_id: this.kind_id,
|
||||
loadComplete: false,
|
||||
}),
|
||||
this.getOrderlist();
|
||||
loadComplete: false
|
||||
}), this.getOrderlist()
|
||||
},
|
||||
allOrders: function() {
|
||||
this.setData({
|
||||
@ -502,9 +290,8 @@ export default {
|
||||
flag: true,
|
||||
type: 0,
|
||||
kind_id: this.kind_id,
|
||||
loadComplete: false,
|
||||
}),
|
||||
this.getOrderlist();
|
||||
loadComplete: false
|
||||
}), this.getOrderlist()
|
||||
},
|
||||
toBePaid: function() {
|
||||
this.setData({
|
||||
@ -516,9 +303,8 @@ export default {
|
||||
flag: true,
|
||||
type: this.StateCode.ORDER_STATE_WAIT_PAY,
|
||||
kind_id: this.kind_id,
|
||||
loadComplete: false,
|
||||
}),
|
||||
this.getOrderlist();
|
||||
loadComplete: false
|
||||
}), this.getOrderlist()
|
||||
},
|
||||
toBeShipping: function() {
|
||||
this.setData({
|
||||
@ -530,9 +316,8 @@ export default {
|
||||
flag: true,
|
||||
type: this.StateCode.ORDER_STATE_WAIT_SHIPPING,
|
||||
kind_id: this.kind_id,
|
||||
loadComplete: false,
|
||||
}),
|
||||
this.getOrderlist();
|
||||
loadComplete: false
|
||||
}), this.getOrderlist()
|
||||
},
|
||||
receiptOfGoods: function() {
|
||||
this.setData({
|
||||
@ -544,9 +329,8 @@ export default {
|
||||
orderlist: [],
|
||||
type: this.StateCode.ORDER_STATE_SHIPPED,
|
||||
kind_id: this.kind_id,
|
||||
loadComplete: false,
|
||||
}),
|
||||
this.getOrderlist();
|
||||
loadComplete: false
|
||||
}), this.getOrderlist()
|
||||
},
|
||||
toBeEvaluated: function() {
|
||||
this.setData({
|
||||
@ -558,15 +342,14 @@ export default {
|
||||
orderlist: [],
|
||||
type: this.StateCode.ORDER_STATE_FINISH,
|
||||
kind_id: this.kind_id,
|
||||
loadComplete: false,
|
||||
}),
|
||||
this.getOrderlist();
|
||||
loadComplete: false
|
||||
}), this.getOrderlist()
|
||||
},
|
||||
scrollbottom: function() {
|
||||
if (this.flag) {
|
||||
var that = this;
|
||||
that.setData({
|
||||
flag: false,
|
||||
flag: false
|
||||
});
|
||||
|
||||
clearTimeout(t);
|
||||
@ -575,11 +358,11 @@ export default {
|
||||
state_type: that.type,
|
||||
flag: false,
|
||||
page: parseInt(that.page) + 1,
|
||||
rows: 10,
|
||||
rows: 10
|
||||
});
|
||||
|
||||
that.getOrderlist();
|
||||
}, 100);
|
||||
that.getOrderlist()
|
||||
}, 100)
|
||||
}
|
||||
},
|
||||
getOrderlist: function() {
|
||||
@ -589,7 +372,7 @@ export default {
|
||||
rows: that.rows,
|
||||
state_type: that.type,
|
||||
kind_id: this.kind_id,
|
||||
card_kind_id: this.card_kind_id,
|
||||
card_kind_id: this.card_kind_id
|
||||
};
|
||||
that.$.request({
|
||||
url: this.Config.URL.user.order_lists,
|
||||
@ -600,45 +383,44 @@ export default {
|
||||
that.setData({
|
||||
flag: false,
|
||||
ispage: false,
|
||||
orderlist: that.orderlist.concat(data.items),
|
||||
});
|
||||
orderlist: that.orderlist.concat(data.items)
|
||||
})
|
||||
} else {
|
||||
that.setData({
|
||||
flag: true,
|
||||
ispage: true,
|
||||
orderlist: that.orderlist.concat(data.items),
|
||||
});
|
||||
orderlist: that.orderlist.concat(data.items)
|
||||
})
|
||||
}
|
||||
|
||||
that.setData({
|
||||
isdata: true,
|
||||
loadComplete: true,
|
||||
});
|
||||
loadComplete: true
|
||||
})
|
||||
|
||||
} else {
|
||||
that.setData({
|
||||
flag: false,
|
||||
ispage: false,
|
||||
isdata: false,
|
||||
loadComplete: true,
|
||||
});
|
||||
loadComplete: true
|
||||
})
|
||||
}
|
||||
},
|
||||
fail: function(data) {
|
||||
that.setData({
|
||||
loadComplete: true,
|
||||
loadComplete: true
|
||||
});
|
||||
that.$.alert("网络异常请重试!");
|
||||
},
|
||||
}
|
||||
});
|
||||
},
|
||||
cancelOrder: function(e) {
|
||||
var that = this,
|
||||
params = {
|
||||
order_id: e.currentTarget.dataset.on,
|
||||
order_id: e.currentTarget.dataset.on
|
||||
};
|
||||
that.$.confirm(
|
||||
that.__("是否取消订单"),
|
||||
function (e) {
|
||||
that.$.confirm(that.__("是否取消订单"), function(e) {
|
||||
if (e.confirm) {
|
||||
that.$.request({
|
||||
url: that.Config.URL.user.order_cancel,
|
||||
@ -648,26 +430,22 @@ export default {
|
||||
that.$.alert("取消成功!", function() {
|
||||
that.setData({
|
||||
orderlist: [],
|
||||
page: 1,
|
||||
page: 1
|
||||
});
|
||||
that.getOrderlist();
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
}, true)
|
||||
},
|
||||
writeOrder: function(e) {
|
||||
var that = this,
|
||||
params = {
|
||||
order_id: e.currentTarget.dataset.on,
|
||||
order_id: e.currentTarget.dataset.on
|
||||
};
|
||||
that.$.confirm(
|
||||
"是否核销订单?",
|
||||
function (e) {
|
||||
that.$.confirm("是否核销订单?", function(e) {
|
||||
if (e.confirm) {
|
||||
that.$.request({
|
||||
url: that.Config.URL.user.order_receive,
|
||||
@ -678,41 +456,36 @@ export default {
|
||||
that.setData({
|
||||
orderlist: [],
|
||||
page: 1,
|
||||
Info: msg,
|
||||
Info: msg
|
||||
});
|
||||
setTimeout(function() {
|
||||
that.getOrderlist();
|
||||
}, 1000);
|
||||
that.getOrderlist()
|
||||
}, 1000)
|
||||
});
|
||||
} else {
|
||||
(that.setData({
|
||||
orderlist: [],
|
||||
Info: msg,
|
||||
show: true,
|
||||
}),
|
||||
setTimeout(function () {
|
||||
show: true
|
||||
}), setTimeout(function() {
|
||||
that.setData({
|
||||
show: false,
|
||||
});
|
||||
}, 2e3)),
|
||||
that.getOrderlist();
|
||||
show: false
|
||||
})
|
||||
}, 2e3)), that.getOrderlist()
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
|
||||
}, true)
|
||||
},
|
||||
confirmReceipt: function(obj) {
|
||||
var params = {
|
||||
order_id: obj.currentTarget.dataset.on,
|
||||
order_id: obj.currentTarget.dataset.on
|
||||
};
|
||||
|
||||
var that = this;
|
||||
that.$.confirm(
|
||||
that.__("是否确认收货?"),
|
||||
function (e) {
|
||||
that.$.confirm(that.__("是否确认收货?"), function(e) {
|
||||
if (e.confirm) {
|
||||
that.$.request({
|
||||
url: that.Config.URL.user.order_receive,
|
||||
@ -722,63 +495,59 @@ export default {
|
||||
that.$.alert(that.__("收货成功!"), function() {
|
||||
that.setData({
|
||||
orderlist: [],
|
||||
page: 1,
|
||||
page: 1
|
||||
});
|
||||
setTimeout(function() {
|
||||
that.getOrderlist();
|
||||
}, 1000);
|
||||
that.getOrderlist()
|
||||
}, 1000)
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
|
||||
}, true)
|
||||
},
|
||||
placeAnOrder: function(obj) {
|
||||
var params = {
|
||||
order_id: obj.currentTarget.dataset.on,
|
||||
order_id: obj.currentTarget.dataset.on
|
||||
};
|
||||
|
||||
var that = this;
|
||||
that.$.confirm(
|
||||
that.__("是否再次下单?"),
|
||||
function (e) {
|
||||
that.$.confirm(that.__("是否再次下单?"), function(e) {
|
||||
if (e.confirm) {
|
||||
that.$.request({
|
||||
url: that.Config.URL.user.next_order,
|
||||
data: params,
|
||||
method: "POST",
|
||||
method: 'POST',
|
||||
success: function(data, status, msg, code) {
|
||||
if (200 == status) {
|
||||
that.$.switchTab({
|
||||
url: "/pages/cart/cart",
|
||||
url: '/pages/cart/cart'
|
||||
});
|
||||
} else {
|
||||
that.$.alert(msg);
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
|
||||
}, true)
|
||||
},
|
||||
gotopay: function(e) {
|
||||
var that = this;
|
||||
|
||||
that.setData({
|
||||
order_id: e.currentTarget.dataset.on,
|
||||
paymentData: {
|
||||
'paymentData': {
|
||||
order_id: e.currentTarget.dataset.on,
|
||||
orderSelMoneyAmount: e.currentTarget.dataset.order_payment_amount,
|
||||
|
||||
user_money: this.userInfo.user_money,
|
||||
user_points: this.userInfo.user_points,
|
||||
user_recharge_card: this.userInfo.user_recharge_card,
|
||||
user_sp: this.userInfo.user_sp,
|
||||
},
|
||||
user_sp: this.userInfo.user_sp
|
||||
}
|
||||
});
|
||||
|
||||
this.$refs.paymentBox.show();
|
||||
@ -786,17 +555,13 @@ export default {
|
||||
},
|
||||
|
||||
onCancel: function(e) {
|
||||
return;
|
||||
return
|
||||
},
|
||||
onPaid: function(e) {
|
||||
let that = this;
|
||||
that.$.alert(
|
||||
that.__("支付成功"),
|
||||
function () {
|
||||
that.$.gotopage("/member/order/detail?on=" + e.order_id);
|
||||
},
|
||||
2000
|
||||
);
|
||||
let that = this
|
||||
that.$.alert(that.__('支付成功'), function() {
|
||||
that.$.gotopage("/member/order/detail?on=" + e.order_id)
|
||||
}, 2000)
|
||||
|
||||
if (this.$refs.paymentBox.showBoxView) {
|
||||
this.$refs.paymentBox.cancel();
|
||||
@ -812,12 +577,12 @@ export default {
|
||||
formId: this.formId,
|
||||
WeiXinOpenId: this.userInfo.openId,
|
||||
value: {
|
||||
order_id: order_id,
|
||||
},
|
||||
order_id: order_id
|
||||
}
|
||||
};
|
||||
that.$.sendTpl(params);
|
||||
},
|
||||
},
|
||||
that.$.sendTpl(params)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@ -847,7 +612,7 @@ export default {
|
||||
right: 0;
|
||||
height: 6rpx;
|
||||
border-bottom: 6rpx solid $default-skin-bg;
|
||||
color: #cccccc;
|
||||
color: #CCCCCC;
|
||||
-webkit-transform-origin: 0 100%;
|
||||
transform-origin: 0 100%;
|
||||
-webkit-transform: scaleY(0.5);
|
||||
@ -869,8 +634,10 @@ export default {
|
||||
margin-left: 6rpx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.m-panel-hd:after{
|
||||
border-bottom: 0;
|
||||
border-bottom:0
|
||||
}
|
||||
|
||||
.m-panel-hd label {
|
||||
@ -929,7 +696,7 @@ export default {
|
||||
}
|
||||
|
||||
.m-sort {
|
||||
position: relative;
|
||||
position: relative
|
||||
}
|
||||
|
||||
.m-sort image {
|
||||
@ -944,7 +711,7 @@ export default {
|
||||
.m-product-price text {
|
||||
font-size: 24rpx;
|
||||
color: #999999;
|
||||
margin-left: 6rpx;
|
||||
margin-left: 6rpx
|
||||
}
|
||||
|
||||
.m-tab {
|
||||
@ -962,6 +729,7 @@ export default {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
|
||||
.u-tuan-label {
|
||||
padding: 5rpx;
|
||||
background-color: $default-skin-bg;
|
||||
@ -994,7 +762,7 @@ export default {
|
||||
top: 0px;
|
||||
background: rgba(0, 0, 0, 0.4);
|
||||
overflow: hidden;
|
||||
z-index: 998;
|
||||
z-index: 998
|
||||
}
|
||||
|
||||
.m-product-name {
|
||||
|
||||
@ -71,7 +71,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapState, mapMutations } from "vuex";
|
||||
import { mapState, mapMutations } from 'vuex';
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@ -80,50 +80,41 @@ export default {
|
||||
CommentImgList: [],
|
||||
isDisable: false,
|
||||
show: false,
|
||||
Info: "",
|
||||
Info: '',
|
||||
is_data: false,
|
||||
param: {},
|
||||
|
||||
order_item_id: "",
|
||||
return_buyer_message: "",
|
||||
return_refund_amount: "",
|
||||
return_item_num: "",
|
||||
return_tel: "",
|
||||
order_item_id: '',
|
||||
return_buyer_message:'',
|
||||
return_refund_amount:'',
|
||||
return_item_num:'',
|
||||
return_tel: ''
|
||||
};
|
||||
},
|
||||
computed: mapState([
|
||||
"Config",
|
||||
"StateCode",
|
||||
"notice",
|
||||
"plantformInfo",
|
||||
"shopInfo",
|
||||
"userInfo",
|
||||
"hasLogin",
|
||||
'Config',
|
||||
'StateCode',
|
||||
'notice',
|
||||
'plantformInfo',
|
||||
'shopInfo',
|
||||
'userInfo',
|
||||
'hasLogin'
|
||||
]),
|
||||
onLoad: function(options) {
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.__("售后申请"),
|
||||
title:this.__('售后申请')
|
||||
});
|
||||
|
||||
this.setData({
|
||||
order_item_id: options.order_item_id,
|
||||
});
|
||||
this.refreshData(options);
|
||||
order_item_id: options.order_item_id
|
||||
})
|
||||
this.refreshData(options)
|
||||
},
|
||||
methods: {
|
||||
...mapMutations([
|
||||
"login",
|
||||
"logout",
|
||||
"getPlantformInfo",
|
||||
"forceUserInfo",
|
||||
"getUserInfo",
|
||||
]),
|
||||
...mapMutations(['login', 'logout', 'getPlantformInfo', 'forceUserInfo', 'getUserInfo']),
|
||||
refreshData: function(options){
|
||||
var that = this;
|
||||
var params = {
|
||||
order_id: options.order_id,
|
||||
order_item_id: options.order_item_id,
|
||||
};
|
||||
var params = { order_id: options.order_id, order_item_id: options.order_item_id };
|
||||
|
||||
that.$.request({
|
||||
url: this.Config.URL.user.return_item,
|
||||
@ -134,7 +125,7 @@ export default {
|
||||
if (status == 200) {
|
||||
that.setData({ data_info: data, is_data: true, param: params });
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
},
|
||||
inputOpinion: function(e) {
|
||||
@ -147,28 +138,28 @@ export default {
|
||||
var that = this;
|
||||
var dataInfo = this.data_info;
|
||||
if (dataInfo.comment_image && dataInfo.comment_image.length == 9) {
|
||||
that.$.alert("最多上传9张图片!");
|
||||
that.$.alert('最多上传9张图片!');
|
||||
return;
|
||||
}
|
||||
let ukey = uni.getStorageSync("ukey");
|
||||
let ukey = uni.getStorageSync('ukey');
|
||||
//that.$.showLoading();
|
||||
that.$.chooseImage({
|
||||
count: 1,
|
||||
sizeType: ["compressed"],
|
||||
sizeType: ['compressed'],
|
||||
success: function(n) {
|
||||
that.$.showLoading();
|
||||
var r = n.tempFilePaths;
|
||||
that.$.uploadFile({
|
||||
url: that.Config.URL.upload,
|
||||
method: "POST",
|
||||
method: 'POST',
|
||||
filePath: r[0],
|
||||
name: "upfile",
|
||||
formData: { perm_key: ukey },
|
||||
name: 'upfile',
|
||||
formData: {'perm_key':ukey},
|
||||
//header: { 'content-type': 'multipart/form-data' },
|
||||
success: function(n) {
|
||||
that.$.hideLoading();
|
||||
var up_res = that.$.parseJSON(n.data);
|
||||
debugger;
|
||||
|
||||
var s = up_res.data.url;
|
||||
dataInfo.comment_image.push(s);
|
||||
that.setData({ data_info: dataInfo });
|
||||
@ -178,7 +169,7 @@ export default {
|
||||
},
|
||||
complete: function(e) {
|
||||
that.$.hideLoading();
|
||||
},
|
||||
}
|
||||
});
|
||||
},
|
||||
fail: function(e) {
|
||||
@ -186,7 +177,7 @@ export default {
|
||||
},
|
||||
complete: function(e) {
|
||||
that.$.hideLoading();
|
||||
},
|
||||
}
|
||||
});
|
||||
},
|
||||
delImg: function(e) {
|
||||
@ -194,7 +185,7 @@ export default {
|
||||
var dataInfo = this.data_info;
|
||||
var that = this;
|
||||
that.$.confirm(
|
||||
"是否放弃上传本张图片?",
|
||||
'是否放弃上传本张图片?',
|
||||
function(n) {
|
||||
if (n.confirm) {
|
||||
var i = [];
|
||||
@ -216,74 +207,74 @@ export default {
|
||||
var that = this;
|
||||
var dataInfo = this.data_info;
|
||||
|
||||
if (!that.return_refund_amount) {
|
||||
if (!that.return_refund_amount)
|
||||
{
|
||||
that.$.showModal({
|
||||
title: "提示",
|
||||
content: "退款金额必填!",
|
||||
showCancel: false,
|
||||
});
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
if (that.return_refund_amount < 0) {
|
||||
if (that.return_refund_amount < 0)
|
||||
{
|
||||
that.$.showModal({
|
||||
title: "提示",
|
||||
content: "退款金额必须是正数!",
|
||||
showCancel: false,
|
||||
});
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
that.return_refund_amount >
|
||||
dataInfo.order.item.order_item_can_refund_amount
|
||||
) {
|
||||
if (that.return_refund_amount > dataInfo.order.item.order_item_can_refund_amount)
|
||||
{
|
||||
that.$.showModal({
|
||||
title: "提示",
|
||||
content: "退款金额必须小于可退金额!",
|
||||
showCancel: false,
|
||||
});
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
that.return_item_num >
|
||||
that.data_info.order.item.order_item_can_return_num
|
||||
) {
|
||||
if (that.return_item_num > that.data_info.order.item.order_item_can_return_num)
|
||||
{
|
||||
that.$.showModal({
|
||||
title: "提示",
|
||||
content: "退货数量必须小于等于可退数量!",
|
||||
showCancel: false,
|
||||
});
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
if (!that.return_item_num) {
|
||||
if (!that.return_item_num)
|
||||
{
|
||||
that.$.showModal({
|
||||
title: "提示",
|
||||
content: "退货数量必填!",
|
||||
showCancel: false,
|
||||
});
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
var g = /^[1-9]*[1-9][0-9]*$/;
|
||||
if (!g.test(that.return_item_num)) {
|
||||
if(!g.test(that.return_item_num))
|
||||
{
|
||||
that.$.showModal({
|
||||
title: "提示",
|
||||
content: "退货数量必须是正整数!",
|
||||
showCancel: false,
|
||||
});
|
||||
})
|
||||
return;
|
||||
}
|
||||
|
||||
that.$.confirm(
|
||||
"确认退货?",
|
||||
'确认退货?',
|
||||
function(e) {
|
||||
if (e.confirm) {
|
||||
var comment_image = "";
|
||||
var comment_image = ''
|
||||
if (dataInfo.comment_image) {
|
||||
comment_image = dataInfo.comment_image.toString();
|
||||
comment_image = dataInfo.comment_image.toString()
|
||||
}
|
||||
var params = {
|
||||
order_id: dataInfo.order.order_id,
|
||||
@ -300,11 +291,8 @@ export default {
|
||||
data: params,
|
||||
success: function(data, status, msg, code) {
|
||||
if (status == 200) {
|
||||
that.$.alert("申请退货成功!", function () {
|
||||
let url = that.$.sprintf(
|
||||
"/member/member/returndetail?return_id=%s",
|
||||
data.return.return_id
|
||||
);
|
||||
that.$.alert('申请退货成功!', function() {
|
||||
let url = that.$.sprintf('/member/member/returndetail?return_id=%s', data.return.return_id)
|
||||
that.$.gopage(url);
|
||||
|
||||
/*
|
||||
@ -313,14 +301,16 @@ export default {
|
||||
}, 2e3);
|
||||
*/
|
||||
});
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
that.$.showModal({
|
||||
title: "提示",
|
||||
content: msg,
|
||||
showCancel: false,
|
||||
});
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
@ -337,14 +327,14 @@ export default {
|
||||
var s = e.target.dataset.src;
|
||||
|
||||
that.$.previewImage({ current: s, urls: urls });
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss">
|
||||
@import "../../styles/_variables";
|
||||
@import '../../styles/_variables';
|
||||
|
||||
.m-box-item {
|
||||
margin-bottom: 20rpx;
|
||||
@ -399,7 +389,7 @@ export default {
|
||||
|
||||
.m-right {
|
||||
width: 260rpx;
|
||||
color: #36bc9b;
|
||||
color: #36BC9B;
|
||||
font-size: 26rpx;
|
||||
}
|
||||
|
||||
|
||||
24
pages.json
@ -212,29 +212,7 @@
|
||||
}
|
||||
*/
|
||||
],
|
||||
"subPackages": [
|
||||
{
|
||||
"root": "address",
|
||||
"pages": [
|
||||
{
|
||||
"path": "selectShippingAddress",
|
||||
"style": {
|
||||
"navigationBarTitleText": "选择收货地址"
|
||||
}
|
||||
},
|
||||
{
|
||||
"path": "selectCity",
|
||||
"style": {
|
||||
"navigationBarTitleText": "",
|
||||
"navigationStyle": "custom",
|
||||
"app-plus": {
|
||||
"titleNView": false
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"subPackages": [{
|
||||
"root": "member",
|
||||
"pages": [{
|
||||
"path": "member/protocol",
|
||||
|
||||
1379
pages/cart/cart.vue
@ -1,88 +1,35 @@
|
||||
<template>
|
||||
<view>
|
||||
<tp-search
|
||||
id="tp-search"
|
||||
class="tp-search"
|
||||
:search-text="options.pname"
|
||||
:placeholder="tpSearchPlaceholder"
|
||||
:style="tpSearchStyle"
|
||||
@change="search"
|
||||
></tp-search>
|
||||
<scroll-view
|
||||
scroll-y="true"
|
||||
class="m-product-all u-pa"
|
||||
@scrolltolower="scrollbottom"
|
||||
:scroll-top="scposition"
|
||||
@scroll="scroll"
|
||||
scroll-with-animation="true"
|
||||
:style="ptSearchStyle"
|
||||
>
|
||||
<tp-search id="tp-search" class="tp-search" :search-text="options.pname" :placeholder="tpSearchPlaceholder" :style="tpSearchStyle" @change="search"></tp-search>
|
||||
<scroll-view scroll-y="true" class="m-product-all u-pa" @scrolltolower="scrollbottom" :scroll-top="scposition"
|
||||
@scroll="scroll" scroll-with-animation="true" :style="ptSearchStyle">
|
||||
<view class="fixPaddingTop" v-if="loadPageFlag">
|
||||
<diy
|
||||
id="diy"
|
||||
:BgConfig="BgConfig"
|
||||
:PageContent="PageContent"
|
||||
:pageId="pageId"
|
||||
:PageNav="PageNav"
|
||||
:loadPageFlag="loadPageFlag"
|
||||
></diy>
|
||||
<diy id="diy" :BgConfig="BgConfig" :PageContent="PageContent" :pageId="pageId" :PageNav="PageNav"
|
||||
:loadPageFlag="loadPageFlag"></diy>
|
||||
</view>
|
||||
|
||||
<!--第七个模版-->
|
||||
<scroll-view
|
||||
scroll-x="true"
|
||||
v-if="cat_self.length > 0 || cat_child.length > 0"
|
||||
:class="{
|
||||
'box-grids': 1,
|
||||
'box-grids-border': 0,
|
||||
fixPaddingTop: !loadPageFlag,
|
||||
}"
|
||||
>
|
||||
<scroll-view scroll-x="true" v-if="cat_self.length>0 || cat_child.length>0"
|
||||
:class="{'box-grids':1, 'box-grids-border':0, fixPaddingTop:!loadPageFlag}">
|
||||
<view>
|
||||
<!-- 当前分类 -->
|
||||
<view
|
||||
:class="{ 'box-grid': 1, 'box-grid-border': 0 }"
|
||||
v-for="(items, ii) in cat_self"
|
||||
<view :class="{'box-grid':1, 'box-grid-border':0}" v-for="(items, ii) in cat_self"
|
||||
:key="items.id"
|
||||
:style="{
|
||||
width: 100 / 5 + '%',
|
||||
'padding-top': 10 + 'px',
|
||||
'padding-bottom': 10 + 'px',
|
||||
'padding-left': 10 + 'px',
|
||||
'padding-right': 10 + 'px',
|
||||
'background-color': 'transparent',
|
||||
}"
|
||||
@click="onCategory(items.category_id)"
|
||||
>
|
||||
:style="{width:((100/5))+'%','padding-top':(10)+'px','padding-bottom':(10)+'px','padding-left':(10)+'px','padding-right':(10)+'px','background-color':'transparent'}"
|
||||
@click="onCategory(items.category_id)">
|
||||
<view class="box-grid-icon">
|
||||
<image
|
||||
lazy-load
|
||||
:src="$.img(items.category_image, 80, 80)"
|
||||
></image>
|
||||
<image lazy-load :src="($.img(items.category_image, 80, 80))"></image>
|
||||
</view>
|
||||
<label class="box-grid-label">{{ items.category_name }}</label>
|
||||
</view>
|
||||
|
||||
<!-- 子分类 -->
|
||||
<view
|
||||
:class="{ 'box-grid': 1, 'box-grid-border': 0 }"
|
||||
v-for="(items, ii) in cat_child"
|
||||
<view :class="{'box-grid':1, 'box-grid-border':0}" v-for="(items, ii) in cat_child"
|
||||
:key="items.id"
|
||||
:style="{
|
||||
width: 100 / 5 + '%',
|
||||
'padding-top': 10 + 'px',
|
||||
'padding-bottom': 10 + 'px',
|
||||
'padding-left': 10 + 'px',
|
||||
'padding-right': 10 + 'px',
|
||||
'background-color': 'transparent',
|
||||
}"
|
||||
@click="onCategory(items.category_id)"
|
||||
>
|
||||
:style="{width:((100/5))+'%','padding-top':(10)+'px','padding-bottom':(10)+'px','padding-left':(10)+'px','padding-right':(10)+'px','background-color':'transparent'}"
|
||||
@click="onCategory(items.category_id)">
|
||||
<view class="box-grid-icon">
|
||||
<image
|
||||
lazy-load
|
||||
:src="$.img(items.category_image, 80, 80)"
|
||||
></image>
|
||||
<image lazy-load :src="($.img(items.category_image, 80, 80))"></image>
|
||||
</view>
|
||||
<label class="box-grid-label">{{ items.category_name }}</label>
|
||||
</view>
|
||||
@ -91,44 +38,24 @@
|
||||
<!--第七个模版-->
|
||||
|
||||
<!--301模板-->
|
||||
<product-list
|
||||
v-if="loaded"
|
||||
ref="productList"
|
||||
:showCatFlag="true"
|
||||
:uniId="ptConfig.uniId"
|
||||
:isFilterFixed="ptConfig.isFilterFixed"
|
||||
:fix-top="ptConfig.topDistance"
|
||||
:isShowFilter="ptConfig.isShowFilter"
|
||||
:isShowLoading="ptConfig.isShowLoading"
|
||||
:options="ptConfig.options"
|
||||
:viewtype="ptConfig.viewtype"
|
||||
:titleText="ptConfig.titleText"
|
||||
:titleColor="ptConfig.titleColor"
|
||||
:bgColor="ptConfig.bgColor"
|
||||
:paddingLeft="ptConfig.paddingLeft"
|
||||
:paddingRight="ptConfig.paddingRight"
|
||||
:css="ptConfig.css"
|
||||
:style="{ backgroundColor: 'transparent' }"
|
||||
></product-list>
|
||||
<product-list v-if="loaded" ref="productList" :showCatFlag="true" :uniId="ptConfig.uniId" :isFilterFixed="ptConfig.isFilterFixed" :fix-top="ptConfig.topDistance"
|
||||
:isShowFilter="ptConfig.isShowFilter" :isShowLoading="ptConfig.isShowLoading"
|
||||
:options="ptConfig.options" :viewtype="ptConfig.viewtype" :titleText="ptConfig.titleText"
|
||||
:titleColor="ptConfig.titleColor" :bgColor="ptConfig.bgColor" :paddingLeft="ptConfig.paddingLeft"
|
||||
:paddingRight="ptConfig.paddingRight" :css="ptConfig.css"
|
||||
:style="{backgroundColor: 'transparent'}"></product-list>
|
||||
<!--301模板-->
|
||||
</scroll-view>
|
||||
|
||||
<view class="u-top-default"> </view>
|
||||
<view class="u-top-default">
|
||||
</view>
|
||||
|
||||
<view class="u-top">
|
||||
<movable-area class="movableArea">
|
||||
<movable-view
|
||||
class="movableView"
|
||||
@touchmove.stop.prevent="doNothing"
|
||||
direction="all"
|
||||
:x="returnPos.initX"
|
||||
:y="returnPos.initY"
|
||||
>
|
||||
<image
|
||||
src="https://static.lancerdt.com/xcxfile/appicon/nav/black/nav_gotop.png"
|
||||
:class="isQuickNav ? 'quicknav' : 'hide'"
|
||||
@tap="returnTop"
|
||||
></image>
|
||||
<movable-view class="movableView" @touchmove.stop.prevent="doNothing" direction="all" :x="returnPos.initX"
|
||||
:y="returnPos.initY">
|
||||
<image src='https://static.lancerdt.com/xcxfile/appicon/nav/black/nav_gotop.png'
|
||||
:class='(isQuickNav?"quicknav":"hide")' @tap="returnTop"></image>
|
||||
</movable-view>
|
||||
</movable-area>
|
||||
</view>
|
||||
@ -137,13 +64,13 @@
|
||||
|
||||
|
||||
<script>
|
||||
import uniDrawer from "@/components/uni-drawer.vue";
|
||||
import uniTag from "@/components/uni-tag/uni-tag.vue";
|
||||
import diy from "@/components/themes/diy.vue";
|
||||
import uniDrawer from '@/components/uni-drawer.vue';
|
||||
import uniTag from '@/components/uni-tag/uni-tag.vue';
|
||||
import diy from '@/components/themes/diy.vue'
|
||||
|
||||
import ProductList from "@/components/product-list";
|
||||
|
||||
import { mapMutations, mapState } from "vuex";
|
||||
import {mapMutations, mapState} from 'vuex';
|
||||
import SearchBox from "@/uni_modules/search-box/components/search-box/search-box";
|
||||
import TpSearch from "@/components/tp-search/tp-search";
|
||||
|
||||
@ -158,23 +85,17 @@ export default {
|
||||
|
||||
sort: 2,
|
||||
|
||||
|
||||
PageContent: [],
|
||||
BgConfig: {
|
||||
BackgroundObj: {
|
||||
type: 1,
|
||||
bgColor: "#ffffff",
|
||||
pathColor: "#f8f8f8",
|
||||
path: "",
|
||||
},
|
||||
},
|
||||
BgConfig: {BackgroundObj: {type: 1, bgColor: '#ffffff', "pathColor": "#f8f8f8", "path": ""}},
|
||||
PageNav: {
|
||||
window: {
|
||||
navigationBarBackgroundColor: "#ffffff",
|
||||
navigationBarTextStyle: "black",
|
||||
navigationBarTitleText: "",
|
||||
backgroundColor: "#f8f8f8",
|
||||
backgroundTextStyle: "dark",
|
||||
},
|
||||
"navigationBarBackgroundColor": "#ffffff",
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "",
|
||||
"backgroundColor": "#f8f8f8",
|
||||
"backgroundTextStyle": "dark"
|
||||
}
|
||||
},
|
||||
loadPageFlag: false,
|
||||
loaded: false,
|
||||
@ -183,28 +104,29 @@ export default {
|
||||
|
||||
shareImg: "",
|
||||
shareTitle: "",
|
||||
chatUrl: "",
|
||||
chatUrl: '',
|
||||
timer: null,
|
||||
|
||||
|
||||
ptConfig: {
|
||||
uniId: "category",
|
||||
uniId: 'category',
|
||||
isFilterFixed: true,
|
||||
topDistance:44,
|
||||
isShowFilter: true,
|
||||
isShowLoading: true,
|
||||
options: {},
|
||||
viewtype: 1,
|
||||
titleText: "",
|
||||
titleColor: "",
|
||||
bgColor: "",
|
||||
titleText: '',
|
||||
titleColor: '',
|
||||
bgColor: '',
|
||||
paddingLeft: 0,
|
||||
paddingRight: 0,
|
||||
css: {padding: "0 10rpx"},
|
||||
},
|
||||
|
||||
returnPos: {
|
||||
initX: "690",
|
||||
initY: "1336",
|
||||
initX: '690',
|
||||
initY: '1336',
|
||||
},
|
||||
|
||||
scposition: 0,
|
||||
@ -227,41 +149,42 @@ export default {
|
||||
uniDrawer,
|
||||
uniTag,
|
||||
diy,
|
||||
ProductList,
|
||||
ProductList
|
||||
},
|
||||
|
||||
computed: mapState([
|
||||
"Config",
|
||||
"StateCode",
|
||||
"notice",
|
||||
"plantformInfo",
|
||||
"shopInfo",
|
||||
"userInfo",
|
||||
"hasLogin",
|
||||
'Config',
|
||||
'StateCode',
|
||||
'notice',
|
||||
'plantformInfo',
|
||||
'shopInfo',
|
||||
'userInfo',
|
||||
'hasLogin'
|
||||
]),
|
||||
mounted() {
|
||||
this.initReturnPos();
|
||||
|
||||
uni.$on("onOpenFilter", (data) => {
|
||||
uni.$on('onOpenFilter', data => {
|
||||
if (data) {
|
||||
this.tpSearchStyle = "z-index: 5;";
|
||||
this.ptSearchStyle = "z-index: 6;";
|
||||
this.tpSearchStyle = "z-index: 5;"
|
||||
this.ptSearchStyle = "z-index: 6;"
|
||||
} else {
|
||||
this.tpSearchStyle = "z-index: 6;";
|
||||
this.ptSearchStyle = "z-index: 5;";
|
||||
this.tpSearchStyle = "z-index: 6;"
|
||||
this.ptSearchStyle = "z-index: 5;"
|
||||
}
|
||||
});
|
||||
})
|
||||
},
|
||||
async onLoad(options) {
|
||||
await this.$onLaunched;
|
||||
this.loaded = true;
|
||||
|
||||
// #ifdef MP-WEIXIN || MP-ALIPAY
|
||||
this.ptConfig.topDistance = this.statusBar - 7 + 44;
|
||||
this.ptConfig.topDistance = (this.statusBar - 7 + 44);
|
||||
// #endif
|
||||
|
||||
|
||||
uni.setNavigationBarTitle({
|
||||
title: this.__("商品列表"),
|
||||
title: this.__('商品列表')
|
||||
});
|
||||
|
||||
var that = this;
|
||||
@ -269,14 +192,12 @@ export default {
|
||||
|
||||
this.pageId = options.page_id ? options.page_id : 0;
|
||||
|
||||
that.$.setNavigationBarTitle({
|
||||
title: options.pname || options.cname || this.__("商品列表"),
|
||||
});
|
||||
that.$.setNavigationBarTitle({title: options.pname || options.cname || this.__('商品列表')});
|
||||
|
||||
that.$.getSystemInfo({
|
||||
success: function (t) {
|
||||
that.setData({ screenHeight: t.screenHeight });
|
||||
},
|
||||
that.setData({screenHeight: t.screenHeight})
|
||||
}
|
||||
});
|
||||
|
||||
/*
|
||||
@ -290,8 +211,8 @@ export default {
|
||||
|
||||
that.ptConfig.options = {
|
||||
store_id: options.store_id,
|
||||
sidx: "product_sale_num",
|
||||
sort: "DESC",
|
||||
sidx: 'product_sale_num',
|
||||
sort: 'DESC',
|
||||
keywords: options.pname,
|
||||
store_category_ids: options.store_category_id,
|
||||
category_id: options.category_id,
|
||||
@ -301,79 +222,56 @@ export default {
|
||||
store_type: options.store_type,
|
||||
page: 1,
|
||||
|
||||
product_unit_price_min: options.product_unit_price_min
|
||||
? options.product_unit_price_min
|
||||
: "",
|
||||
product_unit_price_max: options.product_unit_price_max
|
||||
? options.product_unit_price_max
|
||||
: "",
|
||||
product_unit_price_min: options.product_unit_price_min ? options.product_unit_price_min : '',
|
||||
product_unit_price_max: options.product_unit_price_max ? options.product_unit_price_max : '',
|
||||
|
||||
sp_from: options.sp_from ? options.sp_from : "",
|
||||
sp_to: options.sp_to ? options.sp_to : "",
|
||||
sp_from: options.sp_from ? options.sp_from : '',
|
||||
sp_to: options.sp_to ? options.sp_to : '',
|
||||
|
||||
points_from: options.points_from ? options.points_from : "",
|
||||
points_to: options.points_to ? options.points_to : "",
|
||||
points_from: options.points_from ? options.points_from : '',
|
||||
points_to: options.points_to ? options.points_to : '',
|
||||
|
||||
virtual: options.virtual ? options.virtual : 0,
|
||||
activity_type_ids: options.activity_type_id
|
||||
? [options.activity_type_id]
|
||||
: [],
|
||||
contract_type_ids: options.contract_type_id
|
||||
? [options.contract_type_id]
|
||||
: [],
|
||||
market_category_ids: options.market_category_id
|
||||
? [options.market_category_id]
|
||||
: [],
|
||||
item_ids: options.item_ids ? options.item_ids : "",
|
||||
activity_type_ids: options.activity_type_id ? [options.activity_type_id] : [],
|
||||
contract_type_ids: options.contract_type_id ? [options.contract_type_id] : [],
|
||||
market_category_ids: options.market_category_id ? [options.market_category_id] : [],
|
||||
item_ids: options.item_ids ? options.item_ids : '',
|
||||
// assist: []
|
||||
};
|
||||
}
|
||||
|
||||
if (this.pageId) {
|
||||
//this.getPageInfo(false);
|
||||
}
|
||||
|
||||
this.tpSearchPlaceholder = this.$.__("请输入商品名称");
|
||||
|
||||
this.tpSearchPlaceholder = this.$.__('请输入商品名称')
|
||||
|
||||
if (options.category_id && options.cname) {
|
||||
this.tpSearchPlaceholder = that.$.sprintf(
|
||||
this.$.__("请输入分类 %s 下商品名称"),
|
||||
options.cname
|
||||
);
|
||||
this.tpSearchPlaceholder = that.$.sprintf(this.$.__('请输入分类 %s 下商品名称'), options.cname)
|
||||
}
|
||||
// this.GetPlist(function() {
|
||||
// that.pdlist.length == 0 ? that.setData({ isdata: false }) : that.setData({ isdata: true });
|
||||
// });
|
||||
},
|
||||
methods: {
|
||||
...mapMutations([
|
||||
"login",
|
||||
"logout",
|
||||
"getPlantformInfo",
|
||||
"forceUserInfo",
|
||||
"getUserInfo",
|
||||
]),
|
||||
...mapMutations(['login', 'logout', 'getPlantformInfo', 'forceUserInfo', 'getUserInfo']),
|
||||
initReturnPos: function () {
|
||||
let view = uni.createSelectorQuery().in(this).select(".movableArea");
|
||||
let that = this;
|
||||
|
||||
view
|
||||
.fields(
|
||||
{
|
||||
view.fields({
|
||||
size: true,
|
||||
scrollOffset: true,
|
||||
},
|
||||
(data) => {
|
||||
scrollOffset: true
|
||||
}, data => {
|
||||
if (data) {
|
||||
that.returnPos.initX = data.width;
|
||||
that.returnPos.initY = data.height - 100;
|
||||
}
|
||||
}
|
||||
)
|
||||
.exec();
|
||||
}).exec();
|
||||
|
||||
uni.$on("returnTop", function (data) {
|
||||
uni.$on('returnTop', function (data) {
|
||||
that.returnTop();
|
||||
});
|
||||
})
|
||||
},
|
||||
getPageInfo: function (force_refresh) {
|
||||
var that = this;
|
||||
@ -383,7 +281,7 @@ export default {
|
||||
}
|
||||
|
||||
var params = {
|
||||
page_id: that.pageId,
|
||||
page_id: that.pageId
|
||||
};
|
||||
|
||||
that.$.request({
|
||||
@ -391,7 +289,7 @@ export default {
|
||||
data: params,
|
||||
ajaxCache: {
|
||||
timeout: this.Config.CACHE_EXPIRE,
|
||||
forceRefresh: force_refresh,
|
||||
forceRefresh: force_refresh
|
||||
},
|
||||
success: function (data, status, msg, code) {
|
||||
that.$.stopPullDownRefresh();
|
||||
@ -404,42 +302,39 @@ export default {
|
||||
BgConfig: that.$.parseJSON(data.page_config),
|
||||
PageNav: that.$.parseJSON(data.page_nav),
|
||||
shareImg: data.page_share_image,
|
||||
shareTitle: data.page_share_title,
|
||||
shareTitle: data.page_share_title
|
||||
});
|
||||
|
||||
if (that.PageNav.window.navigationBarTextStyle == "black") {
|
||||
that.PageNav.window.navigationBarTextStyle = "#000000";
|
||||
if (that.PageNav.window.navigationBarTextStyle == 'black') {
|
||||
that.PageNav.window.navigationBarTextStyle = '#000000'
|
||||
}
|
||||
|
||||
if (that.PageNav.window.navigationBarTextStyle == "white") {
|
||||
that.PageNav.window.navigationBarTextStyle = "#ffffff";
|
||||
if (that.PageNav.window.navigationBarTextStyle == 'white') {
|
||||
that.PageNav.window.navigationBarTextStyle = '#ffffff'
|
||||
}
|
||||
|
||||
that.$.setNavigationBarColor({
|
||||
frontColor: that.PageNav.window.navigationBarTextStyle,
|
||||
backgroundColor: that.PageNav.window.navigationBarBackgroundColor,
|
||||
});
|
||||
backgroundColor: that.PageNav.window.navigationBarBackgroundColor
|
||||
})
|
||||
|
||||
if (data.page_name) {
|
||||
that.$.setNavigationBarTitle({
|
||||
title: data.page_name,
|
||||
title: data.page_name
|
||||
});
|
||||
}
|
||||
|
||||
if (that.hasLogin && data.im_enable) {
|
||||
var perm_id = that.$.getStorageSync("uid");
|
||||
var perm_key = that.$.getStorageSync("ukey");
|
||||
let chat_url = that.$.sprintf(
|
||||
"/im/chat/chat?uid=%s",
|
||||
data.im_user_id
|
||||
);
|
||||
var perm_id = that.$.getStorageSync('uid');
|
||||
var perm_key = that.$.getStorageSync('ukey');
|
||||
let chat_url = that.$.sprintf("/im/chat/chat?uid=%s", data.im_user_id);
|
||||
|
||||
that.setData({
|
||||
chatUrl: chat_url,
|
||||
chatUrl: chat_url
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@ -454,13 +349,14 @@ export default {
|
||||
this.setData({
|
||||
pdlist: [],
|
||||
ispage: true, //loading
|
||||
post: post,
|
||||
post: post
|
||||
});
|
||||
|
||||
this.GetPlist();
|
||||
},
|
||||
|
||||
doNothing() {},
|
||||
doNothing() {
|
||||
},
|
||||
|
||||
scroll: function (t) {
|
||||
let that = this;
|
||||
@ -472,52 +368,52 @@ export default {
|
||||
} else {
|
||||
that.setData({
|
||||
opacity: 0,
|
||||
background: "fff",
|
||||
});
|
||||
background: "fff"
|
||||
})
|
||||
}
|
||||
if (t.detail.scrollTop >= this.screenHeight) {
|
||||
this.setData({ isQuickNav: true });
|
||||
this.setData({isQuickNav: true})
|
||||
} else {
|
||||
this.setData({ isQuickNav: false });
|
||||
this.setData({isQuickNav: false})
|
||||
}
|
||||
},
|
||||
|
||||
scrollbottom: function (e) {
|
||||
let that = this;
|
||||
uni.$emit("diy-scrollbottom", { uniId: that.ptConfig.uniId });
|
||||
uni.$emit('diy-scrollbottom', {uniId: that.ptConfig.uniId})
|
||||
},
|
||||
|
||||
search: function (e) {
|
||||
uni.$emit("returnTop");
|
||||
uni.$emit('returnTop')
|
||||
|
||||
let that = this;
|
||||
|
||||
let opts = Object.assign({}, that.ptConfig.options);
|
||||
opts.keywords = e;
|
||||
|
||||
that.ptConfig.options = opts;
|
||||
that.$forceUpdate(); //二维数组,开启强制渲染
|
||||
that.ptConfig.options = opts
|
||||
that.$forceUpdate() //二维数组,开启强制渲染
|
||||
},
|
||||
|
||||
returnTop: function () {
|
||||
let that = this;
|
||||
|
||||
//视图会发生重新渲染
|
||||
that.scposition = that.oldscposition;
|
||||
that.scposition = that.oldscposition
|
||||
|
||||
//当视图渲染结束 重新设置为0
|
||||
that.$nextTick(() => {
|
||||
that.scposition = 0;
|
||||
that.scposition = 0
|
||||
});
|
||||
|
||||
this.setData({ isQuickNav: false });
|
||||
},
|
||||
this.setData({isQuickNav: false})
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
@import "../../styles/_variables.scss";
|
||||
@import '../../styles/_variables.scss';
|
||||
|
||||
.m-product-all{
|
||||
margin-top: 44px;
|
||||
@ -552,11 +448,13 @@ export default {
|
||||
white-space: nowrap;
|
||||
width: 100%;
|
||||
|
||||
|
||||
.box-grid {
|
||||
padding: 40rpx 20rpx;
|
||||
width: 33.33333333%;
|
||||
box-sizing: border-box;
|
||||
|
||||
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
font-size: 36rpx;
|
||||
@ -588,6 +486,7 @@ export default {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
.box-grid-label {
|
||||
|
||||
@ -1,26 +1,8 @@
|
||||
<template>
|
||||
<view
|
||||
class="page"
|
||||
v-if="loadPageFlag"
|
||||
:style="{
|
||||
background:
|
||||
BgConfig.BackgroundObj.type == 1
|
||||
? BgConfig.BackgroundObj.bgColor
|
||||
: 'url(' +
|
||||
BgConfig.BackgroundObj.path +
|
||||
') no-repeat ' +
|
||||
BgConfig.BackgroundObj.pathColor,
|
||||
}"
|
||||
>
|
||||
<view class="page" v-if="loadPageFlag" :style="{background:(BgConfig.BackgroundObj.type==1?BgConfig.BackgroundObj.bgColor:('url('+BgConfig.BackgroundObj.path+') no-repeat '+ BgConfig.BackgroundObj.pathColor))}">
|
||||
<status-bar :backgroundColor="BgConfig.BackgroundObj.bgColor"></status-bar>
|
||||
|
||||
<diy
|
||||
:BgConfig="BgConfig"
|
||||
:PageContent="PageContent"
|
||||
:pageId="pageId"
|
||||
:PageNav="PageNav"
|
||||
:loadPageFlag="loadPageFlag"
|
||||
></diy>
|
||||
<diy :BgConfig="BgConfig" :PageContent="PageContent" :pageId="pageId" :PageNav="PageNav" :loadPageFlag="loadPageFlag"></diy>
|
||||
|
||||
<guess-you-like ref="guessYouLike" :options="options"></guess-you-like>
|
||||
</view>
|
||||
@ -30,7 +12,7 @@
|
||||
<style lang="scss">
|
||||
@import "../../styles/_variables.scss";
|
||||
|
||||
@import "../../styles/layout.scss";
|
||||
@import '../../styles/layout.scss';
|
||||
|
||||
.page {
|
||||
position: absolute;
|
||||
@ -45,12 +27,19 @@
|
||||
</style>
|
||||
|
||||
<script>
|
||||
import statusBar from "../../components/status-bar.vue";
|
||||
import uniNavBar from "@/components/uni-nav-bar/uni-nav-bar.vue";
|
||||
import diy from "../../components/themes/diy.vue";
|
||||
import guessYouLike from "@/components/guess-you-like.vue";
|
||||
import statusBar from '../../components/status-bar.vue'
|
||||
import uniNavBar from '@/components/uni-nav-bar/uni-nav-bar.vue'
|
||||
|
||||
import { mapState, mapMutations } from "vuex";
|
||||
import diy from '../../components/themes/diy.vue'
|
||||
|
||||
import bwSwiper from '@/components/bw-swiper/bw-swiper.vue'
|
||||
|
||||
import guessYouLike from '@/components/guess-you-like.vue'
|
||||
|
||||
import {
|
||||
mapState,
|
||||
mapMutations
|
||||
} from 'vuex'
|
||||
|
||||
export default {
|
||||
/**
|
||||
@ -59,44 +48,22 @@ export default {
|
||||
data: function() {
|
||||
return {
|
||||
options:{},
|
||||
pageId: "",
|
||||
pageId: '',
|
||||
loadPageFlag: false,
|
||||
PageContent: [],
|
||||
BgConfig: {
|
||||
BackgroundObj: {
|
||||
type: 1,
|
||||
bgColor: "#ffffff",
|
||||
pathColor: "#f8f8f8",
|
||||
path: "",
|
||||
},
|
||||
},
|
||||
PageNav: {
|
||||
window: {
|
||||
navigationBarBackgroundColor: "#ffffff",
|
||||
navigationBarTextStyle: "black",
|
||||
navigationBarTitleText: "",
|
||||
backgroundColor: "#f8f8f8",
|
||||
backgroundTextStyle: "dark",
|
||||
},
|
||||
},
|
||||
BgConfig: {BackgroundObj:{type:1, bgColor:'#ffffff' ,"pathColor":"#f8f8f8","path":""}},
|
||||
PageNav:{window:{"navigationBarBackgroundColor":"#ffffff","navigationBarTextStyle":"black","navigationBarTitleText":"","backgroundColor":"#f8f8f8","backgroundTextStyle":"dark"}},
|
||||
shareImg: "",
|
||||
ShareTitle: "",
|
||||
};
|
||||
ShareTitle: ""
|
||||
}
|
||||
},
|
||||
computed: mapState([
|
||||
"Config",
|
||||
"StateCode",
|
||||
"notice",
|
||||
"plantformInfo",
|
||||
"shopInfo",
|
||||
"userInfo",
|
||||
"hasLogin",
|
||||
]),
|
||||
computed: mapState(['Config', 'StateCode', 'notice', 'plantformInfo', 'shopInfo', 'userInfo', 'hasLogin']),
|
||||
components: {
|
||||
diy,
|
||||
statusBar,
|
||||
uniNavBar,
|
||||
guessYouLike,
|
||||
bwSwiper,
|
||||
guessYouLike
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
@ -114,8 +81,8 @@ export default {
|
||||
}
|
||||
|
||||
that.setData({
|
||||
options: options,
|
||||
});
|
||||
options: options
|
||||
})
|
||||
|
||||
that.initData(false);
|
||||
},
|
||||
@ -124,7 +91,7 @@ export default {
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh: function() {
|
||||
this.initData(true);
|
||||
this.initData(true)
|
||||
},
|
||||
|
||||
/**
|
||||
@ -141,45 +108,36 @@ export default {
|
||||
return {
|
||||
title: this.ShareTitle,
|
||||
imageUrl: this.shareImg,
|
||||
path: this.sprintf(
|
||||
"/pagesub/product/tag?tag_id=%s&uid=%s",
|
||||
this.options.tag_id,
|
||||
this.userInfo.user_id
|
||||
),
|
||||
};
|
||||
path: this.sprintf("/pagesub/product/tag?tag_id=%s&uid=%s", this.options.tag_id, this.userInfo.user_id)
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
...mapMutations([
|
||||
"login",
|
||||
"logout",
|
||||
"getPlantformInfo",
|
||||
"forceUserInfo",
|
||||
"getUserInfo",
|
||||
"showCartNum",
|
||||
]),
|
||||
...mapMutations(['login', 'logout', 'getPlantformInfo', 'forceUserInfo', 'getUserInfo', 'showCartNum']),
|
||||
//读取diy内容
|
||||
getDivModel: function(force_refresh) {
|
||||
var that = this,
|
||||
params = {};
|
||||
|
||||
let site_id = that.$.getStorageSync("site_id");
|
||||
let site_id = that.$.getStorageSync('site_id');
|
||||
|
||||
if (site_id) {
|
||||
params["site_id"] = site_id;
|
||||
if (site_id)
|
||||
{
|
||||
params['site_id'] = site_id;
|
||||
}
|
||||
|
||||
|
||||
that.$.request({
|
||||
url: that.Config.URL.index_app,
|
||||
data: params,
|
||||
ajaxCache: {
|
||||
timeout: that.Config.CACHE_EXPIRE,
|
||||
forceRefresh: force_refresh,
|
||||
forceRefresh: force_refresh
|
||||
},
|
||||
success: function(data, status, msg, code) {
|
||||
uni.stopPullDownRefresh();
|
||||
uni.stopPullDownRefresh()
|
||||
that.setData({
|
||||
loadPageFlag: true,
|
||||
loadPageFlag: true
|
||||
});
|
||||
|
||||
that.setData({
|
||||
@ -188,39 +146,34 @@ export default {
|
||||
BgConfig: that.$.parseJSON(data.page_config),
|
||||
PageNav: that.$.parseJSON(data.page_nav),
|
||||
shareImg: data.page_share_image,
|
||||
ShareTitle: data.page_share_title,
|
||||
ShareTitle: data.page_share_title
|
||||
});
|
||||
|
||||
// #ifndef APP-PLUS
|
||||
that.$.setNavigationBarColor({
|
||||
frontColor:
|
||||
that.PageNav.window.navigationBarTextStyle == "white"
|
||||
? "#ffffff"
|
||||
: "#000000",
|
||||
backgroundColor: that.PageNav.window.navigationBarBackgroundColor,
|
||||
frontColor: that.PageNav.window.navigationBarTextStyle == 'white'
|
||||
? '#ffffff'
|
||||
: '#000000',
|
||||
backgroundColor: that.PageNav.window.navigationBarBackgroundColor
|
||||
});
|
||||
// #endif
|
||||
|
||||
if (data.page_name) {
|
||||
if (data.page_name)
|
||||
{
|
||||
that.$.setNavigationBarTitle({
|
||||
title: data.page_name,
|
||||
title: data.page_name
|
||||
});
|
||||
}
|
||||
|
||||
//
|
||||
let $title = data.page_name;
|
||||
let $desc = "";
|
||||
let $link = that.$.sprintf(
|
||||
"%s/h5/pagesub/product/tag?tag_id=%s&uid=%s",
|
||||
that.Config.SiteUrl,
|
||||
that.options.tag_id,
|
||||
that.userInfo.user_id
|
||||
);
|
||||
let $desc = '';
|
||||
let $link = that.$.sprintf("%s/h5/pagesub/product/tag?tag_id=%s&uid=%s", that.Config.SiteUrl, that.options.tag_id, that.userInfo.user_id);
|
||||
let $img_url = that.shareImg;
|
||||
|
||||
//初始化微信分享
|
||||
that.$.wxShare($title, $desc, $link, $img_url);
|
||||
},
|
||||
that.$.wxShare($title, $desc, $link, $img_url)
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
@ -229,18 +182,18 @@ export default {
|
||||
var that = this;
|
||||
var param = {};
|
||||
|
||||
that.getDivModel(force_refresh);
|
||||
that.getDivModel(force_refresh)
|
||||
},
|
||||
|
||||
search() {
|
||||
uni.showToast({
|
||||
title: "搜索",
|
||||
});
|
||||
title: '搜索'
|
||||
})
|
||||
},
|
||||
onSearch(e) {
|
||||
let that = this;
|
||||
that.$.gopage("/pagesub/search/search");
|
||||
},
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -689,13 +689,16 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import uniDrawer from "@/components/uni-drawer/uni-drawer.vue";
|
||||
import uniList from "@/components/uni-list/uni-list.vue";
|
||||
import uniListItem from "@/components/uni-list-item/uni-list-item.vue";
|
||||
import uniDrawer from '@/components/uni-drawer/uni-drawer.vue'
|
||||
import uniList from '@/components/uni-list/uni-list.vue'
|
||||
import uniListItem from '@/components/uni-list-item/uni-list-item.vue'
|
||||
|
||||
import uniBadge from "@/components/uni-badge.vue";
|
||||
import uniBadge from '@/components/uni-badge.vue';
|
||||
|
||||
import { mapState, mapMutations } from "vuex";
|
||||
import {
|
||||
mapState,
|
||||
mapMutations
|
||||
} from 'vuex'
|
||||
|
||||
export default {
|
||||
data: function() {
|
||||
@ -721,9 +724,14 @@ export default {
|
||||
buyer_user_id:0,
|
||||
rightDrawerVehicle:false,
|
||||
clerkinfo:[],
|
||||
Clerk_name: "",
|
||||
Clerk_name:'',
|
||||
Clerk_id: 0,
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
isVirtual: 0,
|
||||
ud_id: 0,
|
||||
spinfo: "",
|
||||
@ -757,20 +765,21 @@ export default {
|
||||
et: "",
|
||||
shipMethod: 0,
|
||||
item_ids: [],
|
||||
store_id: "",
|
||||
chain_id: "",
|
||||
item_id: "",
|
||||
store_id: '',
|
||||
chain_id: '',
|
||||
item_id: '',
|
||||
balance: 0,
|
||||
isBalance: true,
|
||||
isCoupon: true,
|
||||
isTmplMsg: true,
|
||||
can_delivery: false,
|
||||
ifcart: false,
|
||||
cart_id: "",
|
||||
cart_id: '',
|
||||
order_amount: 0,
|
||||
ChainInfo: {},
|
||||
latitude: "",
|
||||
longitude: "",
|
||||
latitude:'',
|
||||
longitude:'',
|
||||
|
||||
|
||||
urlArgs: {},
|
||||
delivery_item_none_row:[],
|
||||
@ -779,32 +788,28 @@ export default {
|
||||
product_service_contactor_flag:false,
|
||||
|
||||
showPopupFlag: false,
|
||||
popupMsg: "",
|
||||
popupMsg: '',
|
||||
|
||||
isFightGroup: 0,
|
||||
|
||||
order_items_material:[],
|
||||
order_items_fictitious:[],
|
||||
|
||||
detail: "", //
|
||||
|
||||
salesperson_id: "", //销售员Id
|
||||
};
|
||||
|
||||
|
||||
detail:'', //
|
||||
|
||||
|
||||
salesperson_id:'' //销售员Id
|
||||
}
|
||||
},
|
||||
computed: mapState([
|
||||
"Config",
|
||||
"StateCode",
|
||||
"notice",
|
||||
"plantformInfo",
|
||||
"shopInfo",
|
||||
"userInfo",
|
||||
"hasLogin",
|
||||
]),
|
||||
computed: mapState(['Config', 'StateCode', 'notice', 'plantformInfo', 'shopInfo', 'userInfo', 'hasLogin']),
|
||||
components: {
|
||||
uniDrawer,
|
||||
uniList,
|
||||
uniListItem,
|
||||
uniBadge,
|
||||
uniBadge
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
@ -816,6 +821,7 @@ export default {
|
||||
});
|
||||
*/
|
||||
|
||||
|
||||
var that = this;
|
||||
|
||||
let bar_bottom = 0;
|
||||
@ -825,10 +831,11 @@ export default {
|
||||
|
||||
that.setData({
|
||||
buyer_user_id:options.u_id,
|
||||
cartlist: uni.getStorageSync("items"),
|
||||
});
|
||||
cartlist:uni.getStorageSync('items')
|
||||
})
|
||||
|
||||
that.getStorage()
|
||||
|
||||
that.getStorage();
|
||||
},
|
||||
|
||||
onShow: function() {
|
||||
@ -840,42 +847,35 @@ export default {
|
||||
*/
|
||||
onUnload: function() {
|
||||
// 离开页面,注销事件
|
||||
var that = this;
|
||||
var that = this
|
||||
this.notice.removeNotification("RefreshCart", that);
|
||||
this.notice.removeNotification("RefreshCoupon", that);
|
||||
},
|
||||
|
||||
onPullDownRefresh: function() {
|
||||
this.getCartList();
|
||||
this.getCartList()
|
||||
},
|
||||
|
||||
methods: {
|
||||
...mapMutations([
|
||||
"login",
|
||||
"logout",
|
||||
"getPlantformInfo",
|
||||
"forceUserInfo",
|
||||
"getUserInfo",
|
||||
"setCartNum",
|
||||
"showCartNum",
|
||||
]),
|
||||
...mapMutations(['login', 'logout', 'getPlantformInfo', 'forceUserInfo', 'getUserInfo', 'setCartNum', 'showCartNum']),
|
||||
|
||||
|
||||
getStorage: function() {
|
||||
var that = this;
|
||||
var that = this
|
||||
|
||||
this.notice.addNotification("RefreshCoupon", that.RefreshCoupon, that);
|
||||
|
||||
var pat = [];
|
||||
var params = {};
|
||||
var pat = []
|
||||
var params = {}
|
||||
for(var i in that.cartlist){
|
||||
if(that.cartlist[i].cart_quantity > 0){
|
||||
var t =
|
||||
that.cartlist[i].item_id + "|" + that.cartlist[i].cart_quantity;
|
||||
pat.push(t);
|
||||
var t = that.cartlist[i].item_id + '|' + that.cartlist[i].cart_quantity
|
||||
pat.push(t)
|
||||
}
|
||||
}
|
||||
if (pat) {
|
||||
params.cart_id = pat.join(",");
|
||||
if(pat)
|
||||
{
|
||||
params.cart_id = pat.join(',');
|
||||
params.if_chain = 0;
|
||||
params.buyer_user_id = that.buyer_user_id;
|
||||
}
|
||||
@ -885,37 +885,46 @@ export default {
|
||||
data: params,
|
||||
success: function(data, status, msg, code) {
|
||||
if (200 == status) {
|
||||
var n = new Date(),
|
||||
var n = new Date,
|
||||
r = new Date(n);
|
||||
r.setDate(n.getDate() + parseInt(3600 * 24 * 360));
|
||||
var stdate =
|
||||
n.getFullYear() + "-" + (n.getMonth() + 1) + "-" + n.getDate(),
|
||||
eddate =
|
||||
r.getFullYear() + "-" + (r.getMonth() + 1) + "-" + r.getDate();
|
||||
var stdate = n.getFullYear() + "-" + (n.getMonth() + 1) + "-" + n.getDate(),
|
||||
eddate = r.getFullYear() + "-" + (r.getMonth() + 1) + "-" + r.getDate();
|
||||
|
||||
var ud_id = 0;
|
||||
if (!that.$.isNull(data.delivery_address_row)) {
|
||||
ud_id = data.delivery_address_row.ud_id;
|
||||
} else {
|
||||
}
|
||||
if (data.items.length > 0) {
|
||||
} else {}
|
||||
if(data.items.length > 0)
|
||||
{
|
||||
|
||||
|
||||
if (data.if_virtual) {
|
||||
|
||||
var item_row = data.items[0].items[0];
|
||||
that.setData({
|
||||
order_items_material:[],
|
||||
order_items_fictitious: [],
|
||||
});
|
||||
order_items_fictitious:[]
|
||||
})
|
||||
|
||||
for(var t in data.items[0].items)
|
||||
{
|
||||
|
||||
if(data.items[0].items[t].kind_id == 1201)
|
||||
{
|
||||
|
||||
that.order_items_material.push(data.items[0].items[t])
|
||||
}
|
||||
else
|
||||
{
|
||||
that.order_items_fictitious.push(data.items[0].items[t])
|
||||
|
||||
for (var t in data.items[0].items) {
|
||||
if (data.items[0].items[t].kind_id == 1201) {
|
||||
that.order_items_material.push(data.items[0].items[t]);
|
||||
} else {
|
||||
that.order_items_fictitious.push(data.items[0].items[t]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
that.setData({
|
||||
item_ids: [item_row.item_id],
|
||||
item_ids: [item_row.item_id]
|
||||
});
|
||||
|
||||
// that.drawSelf(item_row.store_id);
|
||||
@ -923,34 +932,41 @@ export default {
|
||||
that.setData({
|
||||
isVirtual: data.if_virtual,
|
||||
product_service_date_flag: item_row.product_service_date_flag,
|
||||
product_service_contactor_flag:
|
||||
item_row.product_service_contactor_flag,
|
||||
product_service_contactor_flag: item_row.product_service_contactor_flag,
|
||||
ud_id: ud_id,
|
||||
store_id: item_row.store_id,
|
||||
chainFlag: item_row.product_valid_type == 1002 ? false : true,
|
||||
addressFlag:
|
||||
item_row.product_valid_type == 1002 ? true : false,
|
||||
addressFlag: item_row.product_valid_type == 1002 ? true : false,
|
||||
submitinfo: data,
|
||||
eddate: eddate,
|
||||
stdate: stdate,
|
||||
chain_id:that.chain_id,
|
||||
isdata: true,
|
||||
isdata:true
|
||||
});
|
||||
|
||||
} else {
|
||||
var item_row = data.items[0].items[0];
|
||||
that.setData({
|
||||
order_items_material:[],
|
||||
order_items_fictitious: [],
|
||||
});
|
||||
for (var t in data.items[0].items) {
|
||||
if (data.items[0].items[t].kind_id == 1201) {
|
||||
that.order_items_material.push(data.items[0].items[t]);
|
||||
} else {
|
||||
that.order_items_fictitious.push(data.items[0].items[t]);
|
||||
order_items_fictitious:[]
|
||||
})
|
||||
for(var t in data.items[0].items)
|
||||
{
|
||||
if(data.items[0].items[t].kind_id == 1201)
|
||||
{
|
||||
|
||||
that.order_items_material.push(data.items[0].items[t])
|
||||
}
|
||||
else
|
||||
{
|
||||
that.order_items_fictitious.push(data.items[0].items[t])
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (that.chain_id) {
|
||||
|
||||
if (that.chain_id)
|
||||
{
|
||||
// that.drawSelf(item_row.store_id);
|
||||
}
|
||||
|
||||
@ -964,19 +980,27 @@ export default {
|
||||
eddate: eddate,
|
||||
stdate: stdate,
|
||||
chain_id:that.chain_id,
|
||||
isdata: true,
|
||||
isdata:true
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
that.setData({
|
||||
isdata: false,
|
||||
isdata:false
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
that.setData({
|
||||
order_amount: data.orderSelMoneyAmount,
|
||||
order_amount: data.orderSelMoneyAmount
|
||||
});
|
||||
|
||||
|
||||
|
||||
// if (that.user_voucher_id > 0) {
|
||||
// that.useVoucher(that.user_voucher_id);
|
||||
// }
|
||||
@ -989,8 +1013,12 @@ export default {
|
||||
//console.info(err);
|
||||
|
||||
that.$.confirm(err);
|
||||
},
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
},
|
||||
|
||||
drawSelf: function(store_id) {
|
||||
@ -1001,27 +1029,27 @@ export default {
|
||||
success: function(t) {
|
||||
that.setData({
|
||||
latitude: t.latitude,
|
||||
longitude: t.longitude,
|
||||
longitude: t.longitude
|
||||
});
|
||||
that.getNearbylist(store_id);
|
||||
that.getNearbylist(store_id)
|
||||
},
|
||||
fail: function() {
|
||||
that.setData({
|
||||
isdata: true,
|
||||
isdata: true
|
||||
});
|
||||
|
||||
// that.$.alert("授权失败");
|
||||
|
||||
that.getNearbylist(store_id);
|
||||
},
|
||||
that.getNearbylist(store_id)
|
||||
}
|
||||
});
|
||||
|
||||
this.selfpickFlag
|
||||
? this.setData({
|
||||
shipMethod: 1,
|
||||
})
|
||||
: this.setData({
|
||||
shipMethod: 0,
|
||||
|
||||
|
||||
this.selfpickFlag ? this.setData({
|
||||
shipMethod: 1
|
||||
}) : this.setData({
|
||||
shipMethod: 0
|
||||
});
|
||||
|
||||
// this.getCartList();
|
||||
@ -1030,22 +1058,29 @@ export default {
|
||||
|
||||
AddOrder: function() {
|
||||
var that = this;
|
||||
if (that.$.isNull(this.buyer_user_id)) {
|
||||
if (that.$.isNull(this.buyer_user_id))
|
||||
{
|
||||
that.$.confirm(that.__("请选择客户"), function (a) {
|
||||
if (a.confirm) {
|
||||
}
|
||||
});
|
||||
if (a.confirm)
|
||||
{
|
||||
|
||||
return;
|
||||
}
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
if (that.$.isNull(this.submitinfo.items.length > 0)) {
|
||||
that.$.confirm(that.__("请选择商品"), function (a) {});
|
||||
|
||||
return;
|
||||
if (that.$.isNull(this.submitinfo.items.length > 0))
|
||||
{
|
||||
that.$.confirm(that.__("请选择商品"), function (a) {
|
||||
|
||||
})
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
that.saleOrder();
|
||||
that.saleOrder()
|
||||
},
|
||||
RefreshCoupon: function(options) {
|
||||
var that = this;
|
||||
@ -1058,20 +1093,18 @@ export default {
|
||||
//如果当前为不使用store_id
|
||||
if (voucher_items[i].user_voucher_id == options.user_voucher_id) {
|
||||
if (!that.$.inArray(user_voucher_ids, options.user_voucher_id)) {
|
||||
user_voucher_ids.push(options.user_voucher_id);
|
||||
user_voucher_ids.push(options.user_voucher_id)
|
||||
}
|
||||
} else {
|
||||
//删除已经存在的
|
||||
that.$.arrayRemove(
|
||||
user_voucher_ids,
|
||||
voucher_items[i].user_voucher_id
|
||||
);
|
||||
that.$.arrayRemove(user_voucher_ids, voucher_items[i].user_voucher_id);
|
||||
}
|
||||
}
|
||||
|
||||
this.setData({
|
||||
user_voucher_ids: user_voucher_ids,
|
||||
});
|
||||
user_voucher_ids: user_voucher_ids
|
||||
})
|
||||
|
||||
|
||||
//修改店铺代金券数据,
|
||||
//todo 未来修改为服务端操作。
|
||||
@ -1098,23 +1131,13 @@ export default {
|
||||
//order_amount = order_amount - voucher_item.voucher_price;
|
||||
//submitinfo.items[sid].store_amount = submitinfo.items[sid].order_money_select_items + submitinfo.items[sid].freight - voucher_item.voucher_price;
|
||||
|
||||
order_amount = parseFloat(
|
||||
(order_amount - voucher_item.voucher_price).toFixed(12)
|
||||
);
|
||||
order_amount = Math.max(0, order_amount);
|
||||
order_amount = parseFloat((order_amount - voucher_item.voucher_price).toFixed(12));
|
||||
order_amount = Math.max(0, order_amount)
|
||||
|
||||
submitinfo.items[sid].store_amount = parseFloat(
|
||||
(
|
||||
submitinfo.items[sid].order_money_select_items +
|
||||
submitinfo.items[sid].freight -
|
||||
voucher_item.voucher_price
|
||||
).toFixed(12)
|
||||
);
|
||||
|
||||
submitinfo.items[sid].store_amount = Math.max(
|
||||
0,
|
||||
submitinfo.items[sid].store_amount
|
||||
);
|
||||
submitinfo.items[sid].store_amount = parseFloat((submitinfo.items[sid].order_money_select_items + submitinfo.items[sid].freight - voucher_item.voucher_price).toFixed(12));
|
||||
|
||||
submitinfo.items[sid].store_amount = Math.max(0, submitinfo.items[sid].store_amount)
|
||||
|
||||
//console.info(submitinfo.items[sid].store_amount)
|
||||
break; //如有发现一个,则退出本次循环。
|
||||
@ -1124,38 +1147,36 @@ export default {
|
||||
|
||||
that.setData({
|
||||
submitinfo: submitinfo,
|
||||
order_amount: order_amount,
|
||||
order_amount: order_amount
|
||||
});
|
||||
//this.getCartList()
|
||||
},
|
||||
|
||||
saleOrder: function(){
|
||||
|
||||
var that = this;
|
||||
|
||||
var params = {
|
||||
user_id:this.buyer_user_id,
|
||||
delivery_type_id: 16,
|
||||
delivery_type_id:10,
|
||||
clerk_id: that.Clerk_id,
|
||||
items: JSON.stringify(that.cartlist),
|
||||
};
|
||||
items:JSON.stringify(that.cartlist)
|
||||
}
|
||||
|
||||
that.$.request({
|
||||
url: that.Config.URL.seller.Order_Base,
|
||||
method: "POST",
|
||||
method: 'POST',
|
||||
data: params,
|
||||
success: function(data, status, msg, code) {
|
||||
if(status == 200){
|
||||
that.$.alert("添加订单成功!", function () {
|
||||
let url = that.$.sprintf(
|
||||
"/seller/order/detail?on=%s",
|
||||
data.order_id[0]
|
||||
);
|
||||
uni.setStorageSync("items", "");
|
||||
that.$.alert('添加订单成功!', function() {
|
||||
let url = that.$.sprintf('/seller/order/detail?on=%s', data.order_id[0])
|
||||
uni.setStorageSync('items','');
|
||||
that.setData({
|
||||
cartlist: [],
|
||||
num: 0,
|
||||
price: 0,
|
||||
});
|
||||
price: 0
|
||||
})
|
||||
that.$.gopage(url);
|
||||
|
||||
/*
|
||||
@ -1165,10 +1186,13 @@ export default {
|
||||
*/
|
||||
});
|
||||
}else{
|
||||
that.$.confirm(msg, function (a) {});
|
||||
|
||||
that.$.confirm(msg, function (a) {
|
||||
|
||||
})
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
Presuser: function(e) {
|
||||
@ -1178,166 +1202,171 @@ export default {
|
||||
Clerk_name:e.currentTarget.dataset.name,
|
||||
Clerk_id:e.currentTarget.dataset.id,
|
||||
rightDrawerVehicle:false,
|
||||
});
|
||||
})
|
||||
},
|
||||
suitcouponlist: function(e) {
|
||||
var that = this;
|
||||
var urlArgs = that.urlArgs;
|
||||
urlArgs.user_voucher_id = parseInt(
|
||||
e.currentTarget.dataset.user_voucher_id
|
||||
); //当前选中的
|
||||
urlArgs.val = JSON.stringify(
|
||||
that.submitinfo.items[e.currentTarget.dataset.id].voucher_items
|
||||
);
|
||||
urlArgs.user_voucher_id = parseInt(e.currentTarget.dataset.user_voucher_id); //当前选中的
|
||||
urlArgs.val = JSON.stringify(that.submitinfo.items[e.currentTarget.dataset.id].voucher_items);
|
||||
var url = that.$.createUrl("/activity/coupon/member", urlArgs);
|
||||
console.log(url);
|
||||
console.log(url)
|
||||
that.$.navigateTo({
|
||||
url: url,
|
||||
});
|
||||
url: url
|
||||
})
|
||||
},
|
||||
|
||||
removeload: function(e) {
|
||||
//console.info(e);
|
||||
this.setData({
|
||||
X_End: e.touches[0].pageX,
|
||||
});
|
||||
X_End: e.touches[0].pageX
|
||||
})
|
||||
},
|
||||
|
||||
obtainUserInfo: function() {
|
||||
|
||||
var that = this;
|
||||
|
||||
var params = {
|
||||
rows: 100,
|
||||
sidx: "user_id",
|
||||
sord: "asc",
|
||||
};
|
||||
sidx: 'user_id',
|
||||
sord: 'asc'
|
||||
}
|
||||
that.$.request({
|
||||
url: that.Config.URL.seller.select_Clerk,
|
||||
data: params,
|
||||
success: function(data, status, msg, code) {
|
||||
if(status == 200){
|
||||
console.log(13);
|
||||
console.log(data.items);
|
||||
console.log(13)
|
||||
console.log(data.items)
|
||||
that.setData({
|
||||
clerkinfo: data.items,
|
||||
rightDrawerVehicle:true,
|
||||
});
|
||||
})
|
||||
}else{
|
||||
that.$.alert(msg);
|
||||
that.$.alert(msg)
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
pressDelCart: function(e) {
|
||||
var that = this;
|
||||
e.currentTarget.dataset.id;
|
||||
|
||||
let itemList = ["删除"];
|
||||
let itemList = ['删除']
|
||||
|
||||
uni.showActionSheet({
|
||||
itemList: itemList,
|
||||
success: (res) => {
|
||||
if (res.tapIndex == 0) {
|
||||
if (res.tapIndex == 0)
|
||||
{
|
||||
that.delcart(e);
|
||||
} else {
|
||||
}
|
||||
},
|
||||
});
|
||||
else
|
||||
{
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
removestart: function(e) {
|
||||
this.setData({
|
||||
X_Start: e.touches[0].pageX,
|
||||
});
|
||||
X_Start: e.touches[0].pageX
|
||||
})
|
||||
},
|
||||
|
||||
// 删除购物车商品
|
||||
delcart: function(e) {
|
||||
var that = this;
|
||||
var t = e.currentTarget.dataset.id;
|
||||
var t = e.currentTarget.dataset.id
|
||||
that.$.showModal({
|
||||
title: "提示",
|
||||
content: "确认要删除这个商品吗?",
|
||||
success: function(n) {
|
||||
if (n.confirm) {
|
||||
var cart = [];
|
||||
var cart = []
|
||||
|
||||
for(var i in that.cartlist){
|
||||
if (parseInt(that.cartlist[i].item_id) !== parseInt(t)) {
|
||||
cart.push(that.cartlist[i]);
|
||||
if(parseInt(that.cartlist[i].item_id) !== parseInt(t))
|
||||
{
|
||||
cart.push(that.cartlist[i])
|
||||
}
|
||||
}
|
||||
|
||||
that.cartlist = cart;
|
||||
uni.setStorageSync("items", that.cartlist);
|
||||
that.getStorage();
|
||||
that.cartlist = cart
|
||||
uni.setStorageSync('items', that.cartlist);
|
||||
that.getStorage()
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
// 结算
|
||||
submitorder: function() {
|
||||
let that = this;
|
||||
this.isck
|
||||
? that.$.navigateTo({
|
||||
url: "/pages/checkout/checkout?ifcart=1",
|
||||
})
|
||||
: that.$.showModal({
|
||||
this.isck ? that.$.navigateTo({
|
||||
url: "/pages/checkout/checkout?ifcart=1"
|
||||
}) : that.$.showModal({
|
||||
title: "提示",
|
||||
content: "请选择需要结算商品!",
|
||||
showCancel: false,
|
||||
});
|
||||
showCancel: false
|
||||
})
|
||||
},
|
||||
// 删除所有商品
|
||||
delAll: function() {
|
||||
var that = this;
|
||||
that.select_cart_ids.length <= 0
|
||||
? that.$.confirm("请选择需要删除的商品!")
|
||||
: that.$.confirm(
|
||||
"是否删除选中商品?",
|
||||
function (t) {
|
||||
that.select_cart_ids.length <= 0 ? that.$.confirm("请选择需要删除的商品!") : that.$.confirm("是否删除选中商品?", function(t) {
|
||||
if (t.confirm) {
|
||||
var param = {
|
||||
cart_id: that.select_cart_ids.toString(),
|
||||
cart_id: that.select_cart_ids.toString()
|
||||
};
|
||||
that.$.request({
|
||||
url: that.Config.URL.cart.remove,
|
||||
data: param,
|
||||
success: function(data) {
|
||||
that.getCartList();
|
||||
},
|
||||
that.getCartList()
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
true
|
||||
);
|
||||
true)
|
||||
},
|
||||
|
||||
closesp: function() {
|
||||
var that = this;
|
||||
that.setData({
|
||||
selectct: 0,
|
||||
flag: false,
|
||||
}),
|
||||
setTimeout(function () {
|
||||
flag: false
|
||||
}), setTimeout(function() {
|
||||
that.setData({
|
||||
selectsp: 0,
|
||||
});
|
||||
}, 1e3);
|
||||
selectsp: 0
|
||||
})
|
||||
},
|
||||
1e3)
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style lang="scss">
|
||||
@import "../../styles/_variables.scss";
|
||||
|
||||
|
||||
/*店铺信息 start*/
|
||||
|
||||
.m-store:after {
|
||||
content: " ";
|
||||
content: ' ';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
@ -1391,6 +1420,8 @@ export default {
|
||||
|
||||
/*.m-store-info::before {content: " ";position: absolute;left: 0;bottom: 0;right: 0;height: 1rpx;border-bottom: 1rpx solid #e3e3e3;color: #CCCCCC;-webkit-transform-origin: 0 100%;transform-origin: 0 100%;-webkit-transform: scaleY(0.5);transform: scaleY(0.5);z-index: 3;}*/
|
||||
|
||||
|
||||
|
||||
.pre-info-price {
|
||||
height: 18rpx;
|
||||
font-size: 12rpx;
|
||||
@ -1398,11 +1429,14 @@ export default {
|
||||
margin: 0 0 0 10rpx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.m-act-img {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
}
|
||||
|
||||
|
||||
.m-item-act {
|
||||
position: relative;
|
||||
height: 100%;
|
||||
@ -1410,6 +1444,7 @@ export default {
|
||||
height: 100rpx;
|
||||
}
|
||||
|
||||
|
||||
.act-item-name {
|
||||
width: 438rpx;
|
||||
text-overflow: ellipsis;
|
||||
@ -1438,7 +1473,7 @@ export default {
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 4;
|
||||
background-color: rgba(0, 0, 0, 0.2);
|
||||
background-color: rgba(0, 0, 0, 0.2)
|
||||
}
|
||||
|
||||
.m-panel-sp-content {
|
||||
@ -1508,6 +1543,7 @@ export default {
|
||||
|
||||
/*选择规格遮罩 end*/
|
||||
|
||||
|
||||
.u-cart-num {
|
||||
position: absolute;
|
||||
bottom: 20rpx;
|
||||
@ -1542,7 +1578,7 @@ export default {
|
||||
}
|
||||
|
||||
.m-product-item:after {
|
||||
content: " ";
|
||||
content: ' ';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
@ -1583,7 +1619,7 @@ export default {
|
||||
/*底部按钮 start*/
|
||||
|
||||
.m-footer-btn:before {
|
||||
content: " ";
|
||||
content: ' ';
|
||||
position: absolute;
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
@ -1603,7 +1639,7 @@ export default {
|
||||
left: 0;
|
||||
background-color: #fff;
|
||||
border-top: 0rpx solid #e3e3e3;
|
||||
z-index: 3;
|
||||
z-index: 3
|
||||
}
|
||||
|
||||
.m-footer-btn {
|
||||
@ -1670,8 +1706,8 @@ export default {
|
||||
|
||||
/*底部按钮 end*/
|
||||
.del {
|
||||
-webkit-animation: mdel 0.2s 1;
|
||||
animation: mdel 0.2s 1;
|
||||
-webkit-animation: mdel .2s 1;
|
||||
animation: mdel .2s 1;
|
||||
left: -100rpx;
|
||||
}
|
||||
|
||||
@ -1691,7 +1727,7 @@ export default {
|
||||
}
|
||||
|
||||
100% {
|
||||
left: -100rpx;
|
||||
left: -100rpx
|
||||
}
|
||||
}
|
||||
|
||||
@ -1718,7 +1754,7 @@ view {
|
||||
}
|
||||
|
||||
.m-order-typetxt {
|
||||
color: #db384c;
|
||||
color: #DB384C;
|
||||
}
|
||||
|
||||
.m-product-img {
|
||||
|
||||
BIN
static/images/login/qq.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
static/images/login/weibo.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
BIN
static/images/pay_type/ccav.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
static/images/pay_type/credit.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
static/images/pay_type/pay_online.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
static/images/pay_type/paypal.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
static/images/pay_type/payu.png
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
static/images/pay_type/recharge_card.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
static/images/pay_type/redsys.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
@ -1,45 +0,0 @@
|
||||
@font-face {
|
||||
font-family: "iconfontAili"; /* Project id 4752539 */
|
||||
src: url('/static/iconfont.ttf?t=1733159098566') format('truetype');
|
||||
}
|
||||
|
||||
.iconfontAili {
|
||||
font-family: "iconfontAili" !important;
|
||||
font-size: 16px;
|
||||
font-style: normal;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-zengjiatianjiajiahao:before {
|
||||
content: "\e62a";
|
||||
}
|
||||
|
||||
.icon-top:before {
|
||||
content: "\e663";
|
||||
}
|
||||
|
||||
.icon-xiala:before {
|
||||
content: "\e6b9";
|
||||
}
|
||||
|
||||
.icon-dingwei1:before {
|
||||
content: "\e609";
|
||||
}
|
||||
|
||||
.icon-dianpu:before {
|
||||
content: "\e61b";
|
||||
}
|
||||
|
||||
.icon-zhongxindingwei:before {
|
||||
content: "\e644";
|
||||
}
|
||||
|
||||
.icon-right:before {
|
||||
content: "\e7eb";
|
||||
}
|
||||
|
||||
.icon-dingwei:before {
|
||||
content: "\e65f";
|
||||
}
|
||||
|
||||