Authored by hongyong.zhao

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

... ... @@ -5,7 +5,8 @@
"pages/zeroSell/myList",
"pages/zeroSell/snapshootShare",
"pages/zeroSell/h5Page",
"pages/bindPhoneNumber/bindPhoneNumber"
"pages/bindPhoneNumber/bindPhoneNumber",
"pages/choosecountry/choosecountry"
],
"window": {
"navigationBarTextStyle": "white",
... ...
{
"navigationBarTitleText": "选择国家"
}
\ No newline at end of file
... ...
// pages/choosecountry/choosecountry.js
import { API_HOST, SERVICE_HOST } from '../../libs/config';
import { GET, POST } from '../../libs/request';
import { getYHStorageSync } from '../../utils/util';
let CACH_KEY = 'country_cach';
let CHOOSED_COUNTRY_ID = 'CHOOSED_COUNTRY_ID'
let CHOOSED_COUNTRY_NAME = 'CHOOSED_COUNTRY_NAME'
Page({
/**
* 页面的初始数据
*/
data: {
list:[]
},
getArea: function () {
let param={
method: 'app.passport.getArea'
}
GET(API_HOST,param)
.then(json=>{
if(json && json.code == 200){
let datalist = json.data;
if(datalist && datalist.length>0){
// wx.setStorageSync(CACH_KEY, datalist);
this.setData({
list: datalist
})
wx.setStorage({
key: CACH_KEY,
data: datalist,
})
}
}else{
this.useCache();
}
})
.catch(error=>{
this.useCache();
})
},
useCache:function(){
let datalist = getYHStorageSync(CACH_KEY,'choosecountry');
this.setData({
list: datalist
})
},
chooseCountry:function(e){
let country = e.currentTarget.dataset.country;
let country_area = e.currentTarget.dataset.area;
let country_id = e.currentTarget.dataset.id;
wx.setStorage({
key: CHOOSED_COUNTRY_ID,
data: country_area,
})
wx.setStorage({
key: CHOOSED_COUNTRY_NAME,
data: country,
})
// console.log('选择了国家:' + country+":::"+country_area+":::"+country_id)
wx.navigateBack({
delta: 1
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.getArea();
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
}
})
\ No newline at end of file
... ...
<!--pages/choosecountry/choosecountry.wxml-->
<template name='country'>
<view class='countrycontainer' bindtap='chooseCountry' data-country='{{item.name}}'
data-area='{{item.area}}' data-id='{{item.id}}'>
<view class='countryname'>{{item.name}}</view>
<view class='countrycode'>+{{item.area}}</view>
</view>
</template>
<view class='rootcontainer'>
<block wx:for='{{list}}'wx:key="{{index}}">
<template is='country' data="{{item}}"/>
</block>
</view>
... ...
/* pages/choosecountry/choosecountry.wxss */
.rootcontainer{
width: 100%;
height: 100%;
background-color: white;
display: flex;
flex-direction: column;
align-items: center;
}
.countrycontainer{
width: 710rpx;
height: 100rpx;
margin-left: 20rpx;
margin-right: 20rpx;
border-bottom: 1rpx solid #b0b0b0;
display: flex;
flex-direction: row;
align-items: center;
}
.countryname{
text-align: left;
flex: 1;
color: #444444;
font-size: 34rpx;
margin-left: 10rpx
}
.countrycode{
margin-right: 10rpx;
color: #b0b0b0;
font-size: 34rpx
}
::-webkit-scrollbar{
width: 0;
height: 0;
color: transparent
}
\ No newline at end of file
... ...

239 KB | W: | H:

356 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
import Service from './service'
import { ACTIVITY_HOST, API_HOST, MINI_QR_TYPE} from '../../../libs/config';
import { ACTIVITY_HOST, API_HOST, MINI_QR_TYPE, MINI_APP_TYPE} from '../../../libs/config';
const MODULE = '/activity/zerobuy';
... ... @@ -18,6 +18,7 @@ class ZeroSellService extends Service {
}
getList(data) {
data.channel = 0
return this._get('/list', data).then(result => {
if (result.code === 200) {
const products = result.data;
... ... @@ -44,6 +45,7 @@ class ZeroSellService extends Service {
}
getRecommend(data) {
data.channel = 0
return this._get('/list/recommend', data).then(result => {
if (result.code === 200) {
const products = result.data;
... ... @@ -62,6 +64,7 @@ class ZeroSellService extends Service {
}
getMyList(data) {
data.channel = 0
return this._get('/list/mine', data);
}
... ... @@ -78,7 +81,7 @@ class ZeroSellService extends Service {
}
getQrCode(page_param) {
return API_HOST + '/wechat/miniapp/img-check.jpg?param=' + JSON.stringify(page_param) + `&miniQrType=${MINI_QR_TYPE}`;
return API_HOST + '/wechat/miniapp/img-check.jpg?param=' + JSON.stringify(page_param) + `&miniQrType=${MINI_QR_TYPE}` + `&miniapp_type=${MINI_APP_TYPE}`;
}
getUserProfile(data) {
... ...
... ... @@ -59,6 +59,8 @@
.product-qrcode {
width: 160rpx;
height: 160rpx;
margin-left:10rpx;
margin-top:10rpx;
}
.product-defaultImage {
... ... @@ -104,12 +106,26 @@
.price0 {
display: inline-block;
width: 100rpx;
height: 42rpx;
margin-left: 10rpx;
margin-right: 10rpx;
}
.dollarSign {
font-family: SanFranciscoText-Bold;
font-size: 24rpx;
color: #D0021B;
letter-spacing: -0.18px;
text-align: center;
}
.textZero {
font-family: SanFranciscoText-Bold;
font-size: 48rpx;
color: #D0021B;
letter-spacing: -0.18px;
text-align: center;
}
.product-tips {
display: inline-block;
width: 250rpx;
... ...
... ... @@ -29,7 +29,7 @@
"list": []
},
"miniprogram": {
"current": 1,
"current": 4,
"list": [
{
"id": 0,
... ... @@ -58,6 +58,13 @@
"pathName": "pages/zeroSell/index",
"query": "",
"scene": "1011"
},
{
"id": -1,
"name": "登录",
"pathName": "pages/bindPhoneNumber/bindPhoneNumber",
"query": "",
"scene": "1011"
}
]
}
... ...