Authored by hongyong.zhao

修改分享及添加选择国家界面

@@ -5,7 +5,8 @@ @@ -5,7 +5,8 @@
5 "pages/zeroSell/myList", 5 "pages/zeroSell/myList",
6 "pages/zeroSell/snapshootShare", 6 "pages/zeroSell/snapshootShare",
7 "pages/zeroSell/h5Page", 7 "pages/zeroSell/h5Page",
8 - "pages/bindPhoneNumber/bindPhoneNumber" 8 + "pages/bindPhoneNumber/bindPhoneNumber",
  9 + "pages/choosecountry/choosecountry"
9 ], 10 ],
10 "window": { 11 "window": {
11 "navigationBarTextStyle": "white", 12 "navigationBarTextStyle": "white",
  1 +{
  2 + "navigationBarTitleText": "选择国家"
  3 +}
  1 +// pages/choosecountry/choosecountry.js
  2 +import { API_HOST, SERVICE_HOST } from '../../libs/config';
  3 +import { GET, POST } from '../../libs/request';
  4 +import { getYHStorageSync } from '../../utils/util';
  5 +
  6 +let CACH_KEY = 'country_cach';
  7 +let CHOOSED_COUNTRY_ID = 'CHOOSED_COUNTRY_ID'
  8 +let CHOOSED_COUNTRY_NAME = 'CHOOSED_COUNTRY_NAME'
  9 +
  10 +
  11 +Page({
  12 + /**
  13 + * 页面的初始数据
  14 + */
  15 + data: {
  16 + list:[]
  17 + },
  18 + getArea: function () {
  19 + let param={
  20 + method: 'app.passport.getArea'
  21 + }
  22 + GET(API_HOST,param)
  23 + .then(json=>{
  24 + if(json && json.code == 200){
  25 + let datalist = json.data;
  26 + if(datalist && datalist.length>0){
  27 + // wx.setStorageSync(CACH_KEY, datalist);
  28 + this.setData({
  29 + list: datalist
  30 + })
  31 + wx.setStorage({
  32 + key: CACH_KEY,
  33 + data: datalist,
  34 + })
  35 + }
  36 + }else{
  37 + this.useCache();
  38 + }
  39 + })
  40 + .catch(error=>{
  41 + this.useCache();
  42 + })
  43 + },
  44 + useCache:function(){
  45 + let datalist = getYHStorageSync(CACH_KEY,'choosecountry');
  46 + this.setData({
  47 + list: datalist
  48 + })
  49 + },
  50 + chooseCountry:function(e){
  51 + let country = e.currentTarget.dataset.country;
  52 + let country_area = e.currentTarget.dataset.area;
  53 + let country_id = e.currentTarget.dataset.id;
  54 +
  55 + wx.setStorage({
  56 + key: CHOOSED_COUNTRY_ID,
  57 + data: country_area,
  58 + })
  59 +
  60 + wx.setStorage({
  61 + key: CHOOSED_COUNTRY_NAME,
  62 + data: country,
  63 + })
  64 + // console.log('选择了国家:' + country+":::"+country_area+":::"+country_id)
  65 +
  66 + wx.navigateBack({
  67 + delta: 1
  68 + })
  69 +
  70 + },
  71 + /**
  72 + * 生命周期函数--监听页面加载
  73 + */
  74 + onLoad: function (options) {
  75 + this.getArea();
  76 + },
  77 +
  78 + /**
  79 + * 生命周期函数--监听页面初次渲染完成
  80 + */
  81 + onReady: function () {
  82 +
  83 + },
  84 +
  85 + /**
  86 + * 生命周期函数--监听页面显示
  87 + */
  88 + onShow: function () {
  89 +
  90 + },
  91 +
  92 + /**
  93 + * 生命周期函数--监听页面隐藏
  94 + */
  95 + onHide: function () {
  96 +
  97 + },
  98 +
  99 + /**
  100 + * 生命周期函数--监听页面卸载
  101 + */
  102 + onUnload: function () {
  103 +
  104 + },
  105 +
  106 + /**
  107 + * 页面相关事件处理函数--监听用户下拉动作
  108 + */
  109 + onPullDownRefresh: function () {
  110 +
  111 + },
  112 +
  113 + /**
  114 + * 页面上拉触底事件的处理函数
  115 + */
  116 + onReachBottom: function () {
  117 +
  118 + },
  119 +
  120 + /**
  121 + * 用户点击右上角分享
  122 + */
  123 + onShareAppMessage: function () {
  124 +
  125 + }
  126 +})
  1 +<!--pages/choosecountry/choosecountry.wxml-->
  2 + <template name='country'>
  3 + <view class='countrycontainer' bindtap='chooseCountry' data-country='{{item.name}}'
  4 + data-area='{{item.area}}' data-id='{{item.id}}'>
  5 + <view class='countryname'>{{item.name}}</view>
  6 + <view class='countrycode'>+{{item.area}}</view>
  7 + </view>
  8 +</template>
  9 +<view class='rootcontainer'>
  10 + <block wx:for='{{list}}'wx:key="{{index}}">
  11 + <template is='country' data="{{item}}"/>
  12 + </block>
  13 +</view>
  1 +/* pages/choosecountry/choosecountry.wxss */
  2 +.rootcontainer{
  3 + width: 100%;
  4 + height: 100%;
  5 + background-color: white;
  6 + display: flex;
  7 + flex-direction: column;
  8 + align-items: center;
  9 +}
  10 +.countrycontainer{
  11 + width: 710rpx;
  12 + height: 100rpx;
  13 + margin-left: 20rpx;
  14 + margin-right: 20rpx;
  15 + border-bottom: 1rpx solid #b0b0b0;
  16 + display: flex;
  17 + flex-direction: row;
  18 + align-items: center;
  19 +}
  20 +.countryname{
  21 + text-align: left;
  22 + flex: 1;
  23 + color: #444444;
  24 + font-size: 34rpx;
  25 + margin-left: 10rpx
  26 +}
  27 +.countrycode{
  28 + margin-right: 10rpx;
  29 + color: #b0b0b0;
  30 + font-size: 34rpx
  31 +}
  32 +::-webkit-scrollbar{
  33 + width: 0;
  34 + height: 0;
  35 + color: transparent
  36 +}

239 KB | W: | H:

356 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
1 1
2 2
3 import Service from './service' 3 import Service from './service'
4 -import { ACTIVITY_HOST, API_HOST, MINI_QR_TYPE} from '../../../libs/config'; 4 +import { ACTIVITY_HOST, API_HOST, MINI_QR_TYPE, MINI_APP_TYPE} from '../../../libs/config';
5 5
6 const MODULE = '/activity/zerobuy'; 6 const MODULE = '/activity/zerobuy';
7 7
@@ -18,6 +18,7 @@ class ZeroSellService extends Service { @@ -18,6 +18,7 @@ class ZeroSellService extends Service {
18 } 18 }
19 19
20 getList(data) { 20 getList(data) {
  21 + data.channel = 0
21 return this._get('/list', data).then(result => { 22 return this._get('/list', data).then(result => {
22 if (result.code === 200) { 23 if (result.code === 200) {
23 const products = result.data; 24 const products = result.data;
@@ -44,6 +45,7 @@ class ZeroSellService extends Service { @@ -44,6 +45,7 @@ class ZeroSellService extends Service {
44 } 45 }
45 46
46 getRecommend(data) { 47 getRecommend(data) {
  48 + data.channel = 0
47 return this._get('/list/recommend', data).then(result => { 49 return this._get('/list/recommend', data).then(result => {
48 if (result.code === 200) { 50 if (result.code === 200) {
49 const products = result.data; 51 const products = result.data;
@@ -62,6 +64,7 @@ class ZeroSellService extends Service { @@ -62,6 +64,7 @@ class ZeroSellService extends Service {
62 } 64 }
63 65
64 getMyList(data) { 66 getMyList(data) {
  67 + data.channel = 0
65 return this._get('/list/mine', data); 68 return this._get('/list/mine', data);
66 } 69 }
67 70
@@ -78,7 +81,7 @@ class ZeroSellService extends Service { @@ -78,7 +81,7 @@ class ZeroSellService extends Service {
78 } 81 }
79 82
80 getQrCode(page_param) { 83 getQrCode(page_param) {
81 - return API_HOST + '/wechat/miniapp/img-check.jpg?param=' + JSON.stringify(page_param) + `&miniQrType=${MINI_QR_TYPE}`; 84 + return API_HOST + '/wechat/miniapp/img-check.jpg?param=' + JSON.stringify(page_param) + `&miniQrType=${MINI_QR_TYPE}` + `&miniapp_type=${MINI_APP_TYPE}`;
82 } 85 }
83 86
84 getUserProfile(data) { 87 getUserProfile(data) {
@@ -59,6 +59,8 @@ @@ -59,6 +59,8 @@
59 .product-qrcode { 59 .product-qrcode {
60 width: 160rpx; 60 width: 160rpx;
61 height: 160rpx; 61 height: 160rpx;
  62 + margin-left:10rpx;
  63 + margin-top:10rpx;
62 } 64 }
63 65
64 .product-defaultImage { 66 .product-defaultImage {
@@ -104,12 +106,26 @@ @@ -104,12 +106,26 @@
104 106
105 .price0 { 107 .price0 {
106 display: inline-block; 108 display: inline-block;
107 - width: 100rpx;  
108 - height: 42rpx;  
109 margin-left: 10rpx; 109 margin-left: 10rpx;
110 margin-right: 10rpx; 110 margin-right: 10rpx;
111 } 111 }
112 112
  113 +.dollarSign {
  114 + font-family: SanFranciscoText-Bold;
  115 + font-size: 24rpx;
  116 + color: #D0021B;
  117 + letter-spacing: -0.18px;
  118 + text-align: center;
  119 +}
  120 +
  121 +.textZero {
  122 + font-family: SanFranciscoText-Bold;
  123 + font-size: 48rpx;
  124 + color: #D0021B;
  125 + letter-spacing: -0.18px;
  126 + text-align: center;
  127 +}
  128 +
113 .product-tips { 129 .product-tips {
114 display: inline-block; 130 display: inline-block;
115 width: 250rpx; 131 width: 250rpx;
@@ -29,7 +29,7 @@ @@ -29,7 +29,7 @@
29 "list": [] 29 "list": []
30 }, 30 },
31 "miniprogram": { 31 "miniprogram": {
32 - "current": 1, 32 + "current": 4,
33 "list": [ 33 "list": [
34 { 34 {
35 "id": 0, 35 "id": 0,
@@ -58,6 +58,13 @@ @@ -58,6 +58,13 @@
58 "pathName": "pages/zeroSell/index", 58 "pathName": "pages/zeroSell/index",
59 "query": "", 59 "query": "",
60 "scene": "1011" 60 "scene": "1011"
  61 + },
  62 + {
  63 + "id": -1,
  64 + "name": "登录",
  65 + "pathName": "pages/bindPhoneNumber/bindPhoneNumber",
  66 + "query": "",
  67 + "scene": "1011"
61 } 68 }
62 ] 69 ]
63 } 70 }