Commit ea87ad53 authored by caimeng's avatar caimeng

修改准备提包

parent 636d269a
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
"type" : "uniCloud" "type" : "uniCloud"
}, },
{ {
"playground" : "standard", "playground" : "custom",
"type" : "uni-app:app-android" "type" : "uni-app:app-android"
}, },
{ {
......
...@@ -26,15 +26,15 @@ export default { ...@@ -26,15 +26,15 @@ export default {
const appStart = uni.getStorageSync('appStart') const appStart = uni.getStorageSync('appStart')
if (appStart) { if (appStart) {
// uni.switchTab({ uni.switchTab({
// url: "/pages/index/index", url: "/pages/index/index",
// success: function () { success: function () {
// plus.navigator.closeSplashscreen() plus.navigator.closeSplashscreen()
// } }
// }) })
uni.redirectTo({ uni.redirectTo({
url: "/subPackage/order/list", url: "/subPackage/order/order",
success: function () { success: function () {
plus.navigator.closeSplashscreen() plus.navigator.closeSplashscreen()
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -20,7 +20,7 @@ const BASE = { ...@@ -20,7 +20,7 @@ const BASE = {
h5: 'https://ddang-hhym-h5-g.rockstect.cn/index.html' h5: 'https://ddang-hhym-h5-g.rockstect.cn/index.html'
}, },
prod: { prod: {
common: "https://api.yyhock.com", common: "https://portal.rockstect.com",
event: 'https://event.jqtianxia.com', event: 'https://event.jqtianxia.com',
h5: 'https://ddang-hhym-h5.rockstect.com/v1.0.0.html' h5: 'https://ddang-hhym-h5.rockstect.com/v1.0.0.html'
} }
...@@ -38,7 +38,7 @@ let env = process.env.VUE_APP_BASE_NODE_ENV ...@@ -38,7 +38,7 @@ let env = process.env.VUE_APP_BASE_NODE_ENV
*/ */
// #ifdef APP-PLUS // #ifdef APP-PLUS
env = "stest"; env = "prod";
// #endif // #endif
const api = { const api = {
......
...@@ -122,7 +122,7 @@ import API from '@/server/common' ...@@ -122,7 +122,7 @@ import API from '@/server/common'
import { isLogin, switchShowTabbar } from '@/utils/index' import { isLogin, switchShowTabbar } from '@/utils/index'
const cacheIndexData = uni.getStorageSync('dataIndex') ? JSON.parse(uni.getStorageSync('dataIndex')) : null; const cacheIndexData = uni.getStorageSync('dataIndex') ? JSON.parse(uni.getStorageSync('dataIndex')) : null;
const indexGoods = uni.getStorageSync('indexGoods') ? JSON.parse(uni.getStorageSync('indexGoods')) : []; const indexGoods = uni.getStorageSync('indexGoods') ? JSON.parse(uni.getStorageSync('indexGoods')) : [];
let timeOut = null;
console.log('首页数据', cacheIndexData) console.log('首页数据', cacheIndexData)
console.log('沃日', indexGoods) console.log('沃日', indexGoods)
...@@ -174,6 +174,7 @@ export default { ...@@ -174,6 +174,7 @@ export default {
}, },
// 监听页面滚动 // 监听页面滚动
onPageScroll(e) { onPageScroll(e) {
console.log(e.scrollTop,'日日')
if (e.scrollTop > this.Topdistance) { if (e.scrollTop > this.Topdistance) {
this.isFixed = true; this.isFixed = true;
} else { } else {
...@@ -194,7 +195,7 @@ export default { ...@@ -194,7 +195,7 @@ export default {
duration: 0 duration: 0
}) })
this.Topdistance = 0; this.Topdistance = 0;
setTimeout(() => { timeOut = setTimeout(() => {
that.GetTop() // 获取元素距离顶部的距离 that.GetTop() // 获取元素距离顶部的距离
}, 1500) }, 1500)
...@@ -207,6 +208,9 @@ export default { ...@@ -207,6 +208,9 @@ export default {
// 首页流量埋点 // 首页流量埋点
this.buryingPoint('app:index_page_view') this.buryingPoint('app:index_page_view')
}, },
onHide(){
if(timeOut) clearTimeout(timeOut)
},
// 页面下拉刷新 // 页面下拉刷新
async onPullDownRefresh() { async onPullDownRefresh() {
......
import request from '@/utils/request.js' import request from '@/utils/request.js'
export default { export default {
/* 初始化 */ /* 初始化 */
async initTabBar(data) { async initTabBar(data) {
return request('/app/config/switchLoan', 'POST', data); return request('/app/config/switchLoan', 'POST', data);
}, },
/* 初始化APP配置 */ /* 初始化APP配置 */
async initAPPSettings(data) { async initAPPSettings(data) {
return request('/app/version/getSetting', 'POST', data); return request('/app/version/getSetting', 'POST', data);
}, },
/* 初始化贷超配置settings获取手机号 */ /* 初始化贷超配置settings获取手机号 */
async initH5Settings(data) { async initH5Settings(data) {
return request('/app/v1/settings', 'GET', data); return request('/app/v1/settings', 'GET', data);
}, },
/* 初始化首页 */ /* 初始化首页 */
async initIndex(data) { async initIndex(data) {
return request('/app/index', 'POST', data); return request('/app/index', 'POST', data);
}, },
/* 初始化首页商品 */ /* 初始化首页商品 */
async initIndexGoods(data) { async initIndexGoods(data) {
return request('/app/goods/getGoodsPage', 'POST', data); return request('/app/goods/getGoodsPage', 'POST', data);
},
/**********************支付后续的接口 */
// 地址列表
async initAddressList(data) {
return request('/app/goods/getGoodsPage', 'POST', data);
},
// 地址编辑初始化
async initAddress(data) {
return request('/app/goods/getGoodsPage', 'POST', data);
},
// 地址新增/编辑(更新)
async addressSubmit(data) {
return request('/app/goods/getGoodsPage', 'POST', data);
},
// 地址删除
async addressDelete(data) {
return request('/app/goods/getGoodsPage', 'POST', data);
},
// 创建订单快照
async orderCreate(data) {
return request('/app/goods/getGoodsPage', 'POST', data);
},
// 初始化订单快照
async initOrder(data) {
return request('/app/goods/getGoodsPage', 'POST', data);
},
// 订单提交
async orderSubmit(data) {
return request('/app/goods/getGoodsPage', 'POST', data);
},
// 初始化收银台
async initCashier(data) {
return request('/app/goods/getGoodsPage', 'POST', data);
},
// 收银台提交
async cashierSubmit(data) {
return request('/app/goods/getGoodsPage', 'POST', data);
},
// 初始化我的订单
async initOrderList(data) {
return request('/app/goods/getGoodsPage', 'POST', data);
},
// 订单取消
async orderCancel(data) {
return request('/app/goods/getGoodsPage', 'POST', data);
}, },
} }
...@@ -114,11 +114,11 @@ ...@@ -114,11 +114,11 @@
<image src="/static/img-address-null.png"></image> <image src="/static/img-address-null.png"></image>
<text>暂无收货地址~</text> <text>暂无收货地址~</text>
</view> </view>
<view class="a-footer"> <navigator url="/subPackage/address/create" hover-class="navigator-hover" class="a-footer">
<view class="a-btn"> <view class="a-btn">
<text>+添加新收货人</text> <text>+添加新收货人</text>
</view> </view>
</view> </navigator>
</view> </view>
</template> </template>
......
...@@ -11,16 +11,15 @@ ...@@ -11,16 +11,15 @@
<view class="a-form-item"> <view class="a-form-item">
<text class="a-label">手机号码</text> <text class="a-label">手机号码</text>
<view class="a-control"> <view class="a-control">
<uni-easyinput :inputBorder="inputBorder" :placeholderStyle="placeholderStyle" :styles="styles" <uni-easyinput maxlength="11" type="number" :inputBorder="inputBorder"
placeholder="请输入收货人手机号"></uni-easyinput> :placeholderStyle="placeholderStyle" :styles="styles" placeholder="请输入收货人手机号"></uni-easyinput>
</view> </view>
</view> </view>
<view class="a-form-item"> <view class="a-form-item">
<text class="a-label">所在区域</text> <text class="a-label">所在区域</text>
<view class="a-control"> <view class="a-control">
<uni-data-picker placeholder="请选择所在地区" popup-title="请选择所在地区" :localdata="dataTree" v-model="classes" <uni-data-picker placeholder="请选择所在地区" popup-title="请选择所在地区" :localdata="localData" v-model="classes"
@change="onchange" @nodeclick="onnodeclick" @popupopened="onpopupopened" @change="onchange" @nodeclick="onnodeclick">
@popupclosed="onpopupclosed">
</uni-data-picker> </uni-data-picker>
</view> </view>
</view> </view>
...@@ -40,6 +39,7 @@ ...@@ -40,6 +39,7 @@
</template> </template>
<script> <script>
import cityRows from "../../common/city-china/data.json";
export default { export default {
name: "AddressCreate", name: "AddressCreate",
data() { data() {
...@@ -57,37 +57,12 @@ export default { ...@@ -57,37 +57,12 @@ export default {
}, },
classes: '1-2', classes: '1-2',
dataTree: [{ localData: []
text: "一年级",
value: "1-0",
children: [{
text: "1.1班",
value: "1-1"
},
{
text: "1.2班",
value: "1-2"
}]
},
{
text: "二年级",
value: "2-0",
children: [{
text: "2.1班",
value: "2-1"
},
{
text: "2.2班",
value: "2-2"
}]
},
{
text: "三年级",
value: "3-0",
disable: true
}]
} }
}, },
onLoad(){
this.localData = this.get_city_tree()
},
methods: { methods: {
onnodeclick(e) { onnodeclick(e) {
console.log(e); console.log(e);
...@@ -100,6 +75,115 @@ export default { ...@@ -100,6 +75,115 @@ export default {
}, },
onchange(e) { onchange(e) {
console.log('onchange:', e); console.log('onchange:', e);
},
// 节点变化后 (并非已经选择完毕)
onnodeclick(node) {
// console.log(JSON.stringify(node))
},
// 整体选择完成以后
onchange(e) {
const value = e.detail.value
console.log(JSON.stringify(value))
},
// 省市区数据树生成
get_city_tree() {
let res = []
if (cityRows.length) {
// 递归生成
res = this.handleTree(cityRows)
}
return res
},
/**
* 递归生成树结构数据 - 省市区
*
* @param {Object} data
* @param {String} parent_code 上级ID | null代表需要顶部菜单
* @author Rudon https://rudon.blog.csdn.net/
*
* 源数据:
* {
* "code": "110100",
* "name": "北京市",
* "pinyin": "beijingshi",
* "zip_code": "100000",
* "parent_code": "110000",
* "type": 1,
* "first_letter": "B"
* }
*
* 目标:
* {
* text: "XX市",
* value: "810000",
* children: []
* }
*
*/
handleTree(data, parent_code = null) {
let res = []
let keys = {
id: 'code',
pid: 'parent_code',
children: 'children',
text: 'name',
value: 'code'
}
let oneItemDEMO = {
text: '',
value: '',
children: []
}
let oneItem = {}
// 循环
for (let index in data) {
// 判断
if (parent_code === null) {
// 顶级菜单 - 省
if (!data[index].hasOwnProperty(keys.pid) || data[index][keys.pid] == parent_code) {
// 不存在parent_code,或者已匹配
oneItem = JSON.parse(JSON.stringify(oneItemDEMO))
oneItem.text = data[index][keys.text]
oneItem.value = data[index][keys.value]
// 递归下去
oneItem.children = this.handleTree(data, data[index][keys.id])
res.push(oneItem)
} else {
// 匹配不到,跳过
}
} else {
// 非顶级菜单 - 市、区、街道
if (data[index].hasOwnProperty(keys.pid) && data[index][keys.pid] == parent_code) {
// 已匹配
oneItem = JSON.parse(JSON.stringify(oneItemDEMO))
oneItem.text = data[index][keys.text]
oneItem.value = data[index][keys.value]
// 递归下去
oneItem.children = this.handleTree(data, data[index][keys.id])
res.push(oneItem)
} else {
// 匹配不到,跳过
}
}
}
return res
} }
} }
} }
......
<template> <template>
<view class="page-order"> <view class="page-order">
<!-- 没有选择地址 --> <!-- 没有选择地址 -->
<view class="o-address"> <navigator url="/subPackage/address/address" hover-class="navigator-hover" class="o-address">
<view class="o-address-placeholder"> <view class="o-address-placeholder">
<text>请选择地址</text> <text>请选择地址</text>
</view> </view>
<image class="o-address-arrow" src="/static/o-address-arrow.png"></image> <image class="o-address-arrow" src="/static/o-address-arrow.png"></image>
</view> </navigator>
<!-- 选择了地址 --> <!-- 选择了地址 -->
<view class="o-address"> <navigator url="/subPackage/address/address" hover-class="navigator-hover" class="o-address">
<view class="o-address-box"> <view class="o-address-box">
<text class="o-address-area">请选择地址</text> <text class="o-address-area">请选择地址</text>
<text class="o-address-detail">请选择地址</text> <text class="o-address-detail">请选择地址</text>
<text class="o-address-name">请选择地址</text> <text class="o-address-name">请选择地址</text>
</view> </view>
<image class="o-address-arrow" src="/static/o-address-arrow.png"></image> <image class="o-address-arrow" src="/static/o-address-arrow.png"></image>
</view> </navigator>
<view class="o-snapshot"> <view class="o-snapshot">
<view class="s-image"> <view class="s-image">
<image mode="widthFix" src="/static/o-address-arrow.png" /> <image mode="widthFix" src="/static/o-address-arrow.png" />
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
<text></text> <text></text>
<text>8999.00</text> <text>8999.00</text>
</view> </view>
<view class="o-btn"> <view @click="handleSubmit" class="o-btn">
<text>提交订单</text> <text>提交订单</text>
</view> </view>
</view> </view>
...@@ -59,14 +59,37 @@ ...@@ -59,14 +59,37 @@
</template> </template>
<script> <script>
import API from '../../server/common.js'
export default { export default {
data() { data() {
return { return {
form:null,
address:null
}
},
onLoad(){},
onShow(){
const address = uni.getStorageSync('ChooseAddress');
if(address){
this.address = JSON.parse(address);
} }
}, },
methods: { methods: {
// 初始化订单
async init(){
try{
const res = await API.initOrder();
if(res.success){
}
}catch(err){
console.log(err)
}
},
// 订单提交
handleSubmit(){
}
} }
} }
</script> </script>
......
...@@ -143,8 +143,8 @@ export default { ...@@ -143,8 +143,8 @@ export default {
return false return false
} }
// 这里下订单之前应该先查询一下商品的状态,但我们这个只是假的,不知道要不要判断 // 这里下订单之前应该先查询一下商品的状态,但我们这个只是假的,不知道要不要判断
this.Go('uni:/subPackage/order/order') // this.Go('uni:/subPackage/order/order')
// this.Go('uni:/subPackage/detailResult/detailResult', 'redirect') this.Go('uni:/subPackage/detailResult/detailResult', 'redirect')
} }
}, },
Gopurse() { Gopurse() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment