Commit fc431d775e36b1b4d3c261ef41297358f1cc4bd0

Authored by 前端开发-罗建龙
1 parent d5bc6359

移包优化

packageG/pages/store/index.js 0 → 100644
  1 +var o=getApp().globalData.setting;
  2 +Page({
  3 + data:{
  4 + is_get_local_ok:0,
  5 + is_gps:0,
  6 + lat:null,
  7 + lon:null,
  8 + page:1,
  9 + cat_list:null,
  10 + pick_list:null,
  11 + url:o.imghost,
  12 + is_no_more:0,
  13 + key_word:'', //关键字搜索
  14 + cat_id:0, //分类ID
  15 + islading:0,
  16 + },
  17 +
  18 + //调用视频接口
  19 + onLoad:function(e){
  20 + var th=this;
  21 + wx.getLocation({
  22 + type: 'gcj02',
  23 + success: function(res) {
  24 + th.data.lat = res.latitude;
  25 + th.data.lon = res.longitude;
  26 + th.data.is_get_local_ok = 1;
  27 + },
  28 + fail: function(res) {
  29 + th.data.is_get_local_ok = 1;
  30 + if (res.errCode == 2) {
  31 + getApp().confirmBox("请开启GPS定位", null, 25000, !1);
  32 + }
  33 +
  34 + }
  35 + })
  36 + //--获取门店分类---
  37 + getApp().request.get("/api/weshop/storagecategory/page", {
  38 + data: {
  39 + store_id: o.stoid,
  40 + is_show: 1,
  41 + pageSize: 300
  42 + },
  43 + success:function(res){
  44 + if(res.data.code==0){
  45 + th.setData({cat_list:res.data.data.pageData})
  46 + }
  47 + },
  48 + })
  49 + this.get_sto();
  50 + },
  51 +
  52 + //---------拿出门店分类和门店------------
  53 + get_sto() {
  54 + var th = this;
  55 + var timer_get = setInterval(function() {
  56 + if (th.data.is_get_local_ok == 0) return false;
  57 + clearInterval(timer_get);
  58 + th.get_list();
  59 + }, 500)
  60 +
  61 + },
  62 +
  63 + get_list:function(){
  64 + if(this.data.is_no_more==1) return false;
  65 + if(this.data.islading==1) return false;
  66 + this.data.islading=1;
  67 + var th=this,req = getApp().request;
  68 + var dd = {
  69 + store_id: o.stoid,
  70 + isstop: 0,
  71 + pageSize: 10,
  72 + page:th.data.page
  73 + }
  74 + if(th.data.key_word!="" && th.data.key_word!=undefined) {
  75 + dd.keyword=th.data.key_word;
  76 + }
  77 + if(th.data.cat_id){
  78 + dd.category_id=th.data.cat_id;
  79 + }
  80 + if(th.data.lat){
  81 + dd.lat=th.data.lat;
  82 + dd.lon=th.data.lon;
  83 + }
  84 +
  85 +
  86 + wx.showLoading();
  87 + //----------获取门店---------
  88 + req.promiseGet("/api/weshop/pickup/list", {
  89 + data: dd,
  90 + }).then(res => {
  91 + this.data.islading=0;
  92 + wx.hideLoading();
  93 + if(res.data.code==0){
  94 + if(res.data.data.pageData.length<=0){
  95 + th.data.is_no_more=1; return false;
  96 + }
  97 +
  98 + th.data.page=dd.page+1
  99 + var pick_list=th.data.pick_list;
  100 + if(!pick_list) pick_list=[];
  101 + pick_list=pick_list.concat(res.data.data.pageData);
  102 + th.setData({
  103 + pick_list:pick_list
  104 + })
  105 + }
  106 + })
  107 + },
  108 +
  109 + //---加载更多是靠这个函数----
  110 + onReachBottom: function() {
  111 + this.get_list();
  112 + },
  113 +
  114 + lose_focus:function(e){
  115 + var key_word = e.detail.value;
  116 + this.data.key_word=key_word;
  117 + },
  118 +
  119 +
  120 + phone:function(e){
  121 + var index=e.currentTarget.dataset.index;
  122 + var item=this.data.pick_list[index];
  123 + wx.makePhoneCall({
  124 + phoneNumber: item.pickup_phone,
  125 + })
  126 + },
  127 +
  128 + //分类的下拉
  129 + bindPickerChange: function (e) {
  130 + var index = e.detail.value;//这里会获取他的索引值
  131 + var self = this;
  132 + var list = self.data.cat_list;
  133 + var item = list[index];
  134 + this.data.cat_id=item['cat_id'];
  135 + self.setData({
  136 + periodsname: item['cat_name'],
  137 + cid: item['cat_id']
  138 + })
  139 + this.data.page=1;
  140 + this.data.is_no_more=0;
  141 + this.setData({ pick_list:null})
  142 + this.get_list();
  143 +
  144 + },
  145 +
  146 + //搜索关键字
  147 + sear:function(){
  148 + this.data.page=1;
  149 + this.data.is_no_more=0;
  150 + this.setData({ pick_list:null})
  151 + this.get_list();
  152 + },
  153 +
  154 +
  155 + map: function (e) {
  156 + var index = e.currentTarget.dataset.index;//这里会获取他的索引值
  157 + var self = this;
  158 + var list = self.data.pick_list;
  159 + var item = list[index];
  160 +
  161 + wx.openLocation({
  162 + //当前经纬度
  163 + latitude: parseFloat(item.lat),
  164 + longitude: parseFloat(item.lon),
  165 + //缩放级别默认28
  166 + scale: 28,
  167 + //位置名
  168 + name:item.pickup_name,
  169 + //详细地址
  170 + address: item.pickup_address,
  171 + //成功打印信息
  172 + success: function(res) {},
  173 + //失败打印信息
  174 + fail: function(err) {},
  175 + //完成打印信息
  176 + complete: function(info){},
  177 + })
  178 + },
  179 +
  180 +
  181 +
  182 +
  183 +})
0 184 \ No newline at end of file
... ...
packageG/pages/store/index.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "门店列表",
  3 + "enablePullDownRefresh": false,
  4 + "usingComponents": {
  5 + "nav_box": "/components/nav_box/nav_box"
  6 + }
  7 +}
0 8 \ No newline at end of file
... ...
packageG/pages/store/index.wxml 0 → 100644
  1 +<view class="bcolor flex jc_sb">
  2 + <view class="sear_inp flex ai-center">
  3 + <view class="sear_btn" bindtap='sear'>
  4 + <image src="{{url}}/miniapp/images/search.png" style="width: 30rpx; height: 30rpx; margin-left: 10rpx;"></image>
  5 + </view>
  6 + <input bindinput ="lose_focus" class="fs28" value=""/>
  7 + </view>
  8 + <view class="select">
  9 + <picker bindchange="bindPickerChange" value="{{index}}" range="{{cat_list}}" range-key='cat_name'>
  10 + <view class="course_icon">{{periodsname?periodsname:"选择分类"}}</view>
  11 + </picker>
  12 + </view>
  13 +</view>
  14 +<view>
  15 + <view class="box" wx:for="{{pick_list}}">
  16 + <!-- 门店名称 -->
  17 + <view class="pickname">{{item.pickup_name}}</view>
  18 + <!-- 电话 -->
  19 + <view class="mt flex jc_sb" bindtap="phone" data-index="{{index}}" >
  20 + <!-- 左边电话 -->
  21 + <view>{{item.pickup_phone}}</view>
  22 + <!-- 右边按钮 -->
  23 + <view class="buttonclass"><image src='{{url}}/miniapp/images/storelist/store_phone.png' class="fmob"></image>一键拔号</view>
  24 + </view>
  25 + <!-- 电话 -->
  26 + <view class="mt flex jc_sb" bindtap="map" data-index="{{index}}">
  27 + <!-- 左边电话 -->
  28 + <view class="addr">{{item.fulladdress}}</view>
  29 + <!-- 右边按钮 -->
  30 + <view class="buttonclass"><image src='{{url}}/miniapp/images/storelist/store_addr.png' class="faddr"></image>地图导航</view>
  31 + </view>
  32 + </view>
  33 +</view>
  34 +
  35 +<!-- 制作一个圆球导航 -->
  36 +<nav_box></nav_box>
0 37 \ No newline at end of file
... ...
packageG/pages/store/index.wxss 0 → 100644
  1 +.box{
  2 + padding: 10px;
  3 + border-bottom: 10px solid #f5f5f5;
  4 + color: #000000;
  5 +}
  6 +.box .pickname {
  7 + font-size: 32rpx;
  8 + line-height: 80rpx;
  9 + border-bottom: 1rpx solid #EEEEEE;
  10 +}
  11 +
  12 +.box .mt {
  13 + margin-top: 20rpx;
  14 +}
  15 +.addr{ width: 75%;color: #848484;}
  16 +.buttonclass {
  17 + width: 160rpx;
  18 + height: 60rpx;
  19 + line-height: 60rpx;
  20 + text-align: center;
  21 + border: solid 1px #c3172d;
  22 + border-radius: 20rpx;
  23 + font-size: 28rpx;
  24 + color: #c3172d;
  25 +}
  26 +.fmob
  27 +{width: 28rpx;
  28 +height: 32rpx;
  29 +margin-right: 10rpx;
  30 +top: 4rpx;
  31 +position: relative;
  32 +}
  33 +
  34 +.faddr{
  35 +width: 26rpx;
  36 +height: 32rpx;
  37 +margin-right: 6rpx;
  38 +top: 4rpx;
  39 +position: relative;
  40 +}
  41 +
  42 +.bcolor{background-color: #f5f5f5; height: 126rpx;}
  43 +
  44 +.sear_inp{width: 490rpx; background-color:#eaeaea; height: 80rpx; border-radius:5rpx; margin: 25rpx;}
  45 +.sear_inp input{width: 400rpx;}
  46 +.select{height: 80rpx; width: 220rpx;background-color:#eaeaea; margin:25rpx; font-size: 28rpx; line-height: 80rpx;text-align: center }
  47 +.sear_btn{ width: 50rpx; height: 100%; display: flex; align-items: center;}
  48 +
  49 +.border-bottom {
  50 + border-bottom: 2rpx solid #e0e0e0;
  51 +}
  52 +
  53 +.fs22 {
  54 + font-size: 22rpx;
  55 +}
  56 +
  57 +.flexShrink-0 {
  58 + flex-shrink: 0;
  59 +}
  60 +
  61 +.pt16 {
  62 + padding-top: 16rpx;
  63 +}
  64 +
  65 +.maxWidth-340 {
  66 + max-width: 340rpx;
  67 +}
  68 +
  69 +.maxWidth-400 {
  70 + max-width: 400rpx;
  71 +}
  72 +
  73 +
  74 +/* 图标字体 */
  75 +/* @font-face {
  76 + font-family: 'iconfont';
  77 + src: url('//at.alicdn.com/t/font_2054717_8s87fgrotfo.eot');
  78 + src: url('//at.alicdn.com/t/font_2054717_8s87fgrotfo.eot?#iefix') format('embedded-opentype'),
  79 + url('//at.alicdn.com/t/font_2054717_8s87fgrotfo.woff2') format('woff2'),
  80 + url('//at.alicdn.com/t/font_2054717_8s87fgrotfo.woff') format('woff'),
  81 + url('//at.alicdn.com/t/font_2054717_8s87fgrotfo.ttf') format('truetype'),
  82 + url('//at.alicdn.com/t/font_2054717_8s87fgrotfo.svg#iconfont') format('svg');
  83 +}
  84 +
  85 +.iconfont {
  86 + font-family: "iconfont" !important;
  87 + font-size: 28rpx;
  88 + font-style: normal;
  89 + -webkit-font-smoothing: antialiased;
  90 + -moz-osx-font-smoothing: grayscale;
  91 +}
  92 +
  93 +.icon-weizhi:before {
  94 + content: "\e615";
  95 + color: #FFBA10;
  96 +}
  97 +
  98 +.icon-arrow_down:before {
  99 + content: "\e600";
  100 +}
  101 +
  102 +.icon-arrow_right:before {
  103 + content: "\e61f";
  104 +} */
  105 +/* 图标字体 */
  106 +
  107 +
  108 +
  109 +.icon-weizhi {
  110 + color: #FFBA10;
  111 +}
  112 +
  113 +page {
  114 + height: 100%;
  115 + font-size: 28rpx;
  116 +}
  117 +
  118 +.container {
  119 + height: 100%;
  120 +}
  121 +#map {
  122 + /* width: 100%;
  123 + height: ; */
  124 + display: block;
  125 + width: 100%;
  126 + height: 100%;
  127 +}
  128 +.tab-container.active {
  129 + height: calc(100% - 86rpx);
  130 +}
  131 +.map-container.active ~ .tab-container .list-container {
  132 + height: 204rpx;
  133 + overflow: hidden;
  134 +}
  135 +.map-container.active ~ .tab-container .list {
  136 + overflow: hidden;
  137 +}
  138 +.tab-container.active .list-container {
  139 + height: calc(100% - 108rpx - 84rpx);
  140 + background-color: #F7F7F7;
  141 +}
  142 +
  143 +
  144 +.search-container {
  145 + display: flex;
  146 + align-items: center;
  147 + padding: 0 32rpx;
  148 + border-bottom: 2rpx solid #F0F0F0;
  149 +}
  150 +
  151 +.city:after {
  152 + display: inline-block;
  153 + content: '◣';
  154 + font-size: 14rpx;
  155 + padding-left: 8rpx;
  156 + padding-right: 20rpx;
  157 + transform: rotateZ(-45deg);
  158 + position: relative;
  159 + top: -16rpx;
  160 +}
  161 +
  162 +.input-container {
  163 + padding: 12rpx 0;
  164 + flex: 1;
  165 +}
  166 +
  167 +.input {
  168 + padding: 0 20rpx;
  169 + height: 60rpx;
  170 + line-height: 60rpx;
  171 + border-radius: 30rpx;
  172 + background-color: #F3F3F3;
  173 +}
  174 +
  175 +.placeholder {
  176 + color: #676767;
  177 + font-size: 24rpx;
  178 +}
  179 +
  180 +
  181 +
  182 +
  183 +
  184 +/* 切换卡 */
  185 +.tab-title-container {
  186 + display: flex;
  187 + text-align: center;
  188 + border-bottom: 20rpx solid #F7F7F7;
  189 +}
  190 +.tab-title {
  191 + width: 50%;
  192 + line-height: 88rpx;
  193 + position: relative;
  194 +}
  195 +.tab-title.active {
  196 + font-weight: bold;
  197 +}
  198 +.tab-title.active::after {
  199 + position: absolute;
  200 + content: '';
  201 + width: 110rpx;
  202 + height: 4rpx;
  203 + left: 50%;
  204 + bottom: 0;
  205 + transform: translateX(-50%);
  206 + background-color: #FFBA10;
  207 +}
  208 +
  209 +.map-container {
  210 + transition: 0.1s all linear;
  211 + background-color: pink;
  212 +}
  213 +
  214 +.map-container.active {
  215 + height: calc(100% - 86rpx - 80rpx - 200rpx);
  216 + transition: 0.1s all linear;
  217 +}
  218 +
  219 +
  220 +
  221 +
  222 +/* 查看地图 */
  223 +.view-map {
  224 + line-height: 80rpx;
  225 + text-align: center;
  226 + font-size: 24rpx;
  227 + color: #000;
  228 + border-bottom: 2rpx solid #F0F0F0;
  229 +}
  230 +
  231 +
  232 +/* 列表 */
  233 +.list {
  234 + height: 100%;
  235 +}
  236 +.list-item {
  237 + padding: 40rpx 28rpx;
  238 + border-bottom: 2rpx solid #F0F0F0;
  239 + justify-content: space-between;
  240 + background-color: #fff;
  241 +}
  242 +.list-item:last-child {
  243 + border-bottom: none;
  244 +}
  245 +radio .wx-radio-input {
  246 + width: 32rpx;
  247 + height: 32rpx;
  248 +}
  249 +radio .wx-radio-input.wx-radio-input-checked {
  250 + border-color: #333;
  251 + /* border-color: #FFBA10; */
  252 + background-color: white;
  253 +}
  254 +radio .wx-radio-input.wx-radio-input-checked::before {
  255 + display: inline-block;
  256 + content: '';
  257 + width: 24rpx;
  258 + height: 24rpx;
  259 + border-radius: 50%;
  260 + background-color: #333;
  261 + /* background-color: #FFBA10; */
  262 +}
  263 +.name-container {
  264 + padding-left: 14rpx;
  265 + padding-right: 30rpx;
  266 + box-sizing: border-box;
  267 +}
  268 +.name {
  269 + display: flex;
  270 + align-items: center;
  271 + font-size: 30rpx;
  272 + position: relative;
  273 +}
  274 +.address {
  275 + color: #6E6E6E;
  276 + font-size: 26rpx;
  277 + line-height: 34rpx;
  278 + padding-top: 16rpx;
  279 + /* padding-right: 40rpx; */
  280 + text-align: justify;
  281 +}
  282 +.tag {
  283 + color: #FF5B5A;
  284 + border-radius: 6rpx;
  285 + border: 2rpx solid #FF5B5A;
  286 + font-size: 22rpx;
  287 + padding: 0 4rpx;
  288 + flex-shrink: 0;
  289 + margin-left: 4rpx;
  290 +}
  291 +
  292 +.distance {
  293 + color: #6E6E6E;
  294 + font-size: 22rpx;
  295 + line-height: 34rpx;
  296 + padding-top: 16rpx;
  297 + /* word-break: break-all; */
  298 +}
  299 +
  300 +.icon-arrow_right {
  301 + padding-left: 20rpx;
  302 +}
  303 +
  304 +.right {
  305 + min-width: 200rpx;
  306 + text-align: right;
  307 +}
  308 +
  309 +.icon-arrow_down.active {
  310 + display: inline-block;
  311 + transform: rotateZ(180deg);
  312 +}
  313 +
  314 +
  315 +
  316 +
  317 +
  318 +
  319 +
  320 +
  321 +
... ...
packageG/pages/user/express/express.js 0 → 100644
  1 +var e = getApp(), s = e.request,oo=e.globalData,os=oo.setting;
  2 +
  3 +Page({
  4 + data: {
  5 + url: e.globalData.setting.url,
  6 + resourceUrl: e.globalData.setting.imghost,
  7 + delivery: null,
  8 + express: null,
  9 + re_arr:null,//反转后的数组
  10 + error: "快递信息异常"
  11 + },
  12 + onLoad: function(e) {
  13 + this.requestDelivery(e.order_id);
  14 + },
  15 + requestDelivery: function(e) {
  16 + var r = this;
  17 + s.get("/api/order/deliverydoc/page", {
  18 + data: { order_id: e,store_id:os.stoid },
  19 + success: function(e) {
  20 + r.setData({
  21 + delivery: e.data.data.pageData[0],
  22 + }), r.requestExpress();
  23 + }
  24 + });
  25 + },
  26 + requestExpress: function() {
  27 + var s = this;
  28 + wx.request({
  29 + url: this.data.url + "/api/weshop/order/wuliu/" + this.data.delivery.shipping_code + "/" + this.data.delivery.invoice_no + "/" + this.data.delivery.mobile, success: function(e) {
  30 +
  31 + var re_arr = e.data.data.Traces.reverse();
  32 + s.setData({
  33 + express: e.data.data, re_arr: re_arr,
  34 + });
  35 + },
  36 + fail: function(s) {
  37 + e.showWarning("请求失败");
  38 + }
  39 + });
  40 + }
  41 +});
0 42 \ No newline at end of file
... ...
packageG/pages/user/express/express.json 0 → 100644
  1 +{
  2 + "navigationBarTitleText": "查看物流信息"
  3 +}
0 4 \ No newline at end of file
... ...
packageG/pages/user/express/express.wxml 0 → 100644
  1 +<view class="logistics-mes">
  2 + <view class="logistics-num">
  3 + <view class="logistics-title">快递单号 : </view>
  4 + <view class="logistics-cont">{{delivery.invoice_no}}</view>
  5 + </view>
  6 + <view class="logistics-num">
  7 + <view class="logistics-title">承运公司 : </view>
  8 + <view class="logistics-cont">{{delivery.shipping_name}}</view>
  9 + </view>
  10 +
  11 + <view class="logistics-num">
  12 + <view class="logistics-title">物流状态 : </view>
  13 + <view wx:if="{{express.State==0}}" class="logistics-cont">无轨迹</view>
  14 + <view wx:if="{{express.State==2}}" class="logistics-cont">已揽收</view>
  15 + <view wx:if="{{express.State==2}}" class="logistics-cont">在途中</view>
  16 + <view wx:if="{{express.State==3}}" class="logistics-cont">签收</view>
  17 + <view wx:if="{{express.State==4}}" class="logistics-cont">问题件</view>
  18 + </view>
  19 +
  20 +</view>
  21 +<view class="apply-state">
  22 + <view class="state-item">
  23 + <!-- <view class="item-wrap">
  24 + <view wx:if="{{express.State==2}}" class="state-title">在途中</view>
  25 + <view wx:if="{{express.State==3}}" class="state-title">已签收</view>
  26 + <view wx:if="{{express.State==4}}" class="state-title">问题件</view>
  27 + <view class="state-time">{{' '}}</view>
  28 + </view> -->
  29 +
  30 + <view class="item-wrap" wx:for="{{re_arr}}" wx:key="{{index}}">
  31 + <view class="state-title">{{item.AcceptStation}}</view>
  32 + <view class="state-time">{{item.AcceptTime}}</view>
  33 + </view>
  34 + </view>
  35 +</view>
  36 +
  37 +<view class="no_msg" wx:if="{{(!re_arr || re_arr.length==0) && express}}">
  38 + {{express.Reason}}
  39 +</view>
... ...
packageG/pages/user/express/express.wxss 0 → 100644
  1 +.logistics-mes {
  2 + padding: 20rpx 30rpx;
  3 + background-color: #fff;
  4 +}
  5 +
  6 +.logistics-num {
  7 + display: flex;
  8 + line-height: 48rpx;
  9 + font-size: 28rpx;
  10 +}
  11 +
  12 +.logistics-title {
  13 + color: #777;
  14 + margin-right: 20rpx;
  15 +}
  16 +
  17 +.logistics-cont {
  18 + color: #444;
  19 +}
  20 +
  21 +.apply-state {
  22 + margin-top: 20rpx;
  23 + background-color: #fff;
  24 + padding-left: 50rpx;
  25 + padding-top: 60rpx;
  26 +}
  27 +
  28 +.state-item {
  29 + border-left: 1px solid #ccc;
  30 + padding:0 40rpx;
  31 +}
  32 +
  33 +.item-wrap {
  34 + position: relative;
  35 + margin-bottom: 20rpx;
  36 + padding-bottom: 20rpx;
  37 + border-bottom: 1px solid #eee;
  38 + font-size: 24rpx;
  39 + color: #aaa;
  40 + line-height: 1;
  41 +}
  42 +
  43 +.item-wrap::before {
  44 + content: '';
  45 + position: absolute;
  46 + left: -61rpx;
  47 + top: 0;
  48 + width: 26rpx;
  49 + height: 26rpx;
  50 + border-radius: 50%;
  51 + background-color: #e23435;
  52 + border: 4px solid #ed8182;
  53 +}
  54 +
  55 +.state-title {
  56 + font-size: 28rpx;
  57 + font-weight: bold;
  58 + color: #666;
  59 + padding-bottom: 20rpx;
  60 + line-height: 40rpx
  61 +}
  62 +.no_msg{
  63 + text-align: center;color: #999; font-size: 32rpx
  64 +}
0 65 \ No newline at end of file
... ...