Browse Source

修改声明文件;去除商品列表的购物车按钮;充值增加上限;

master
Gao xiaosong 5 years ago
parent
commit
941e04195f
  1. 6
      README.md
  2. 2
      components/GoodList.vue
  3. 55
      pages/user/Recharge/index.vue

6
README.md

@ -1,8 +1,8 @@
# 使用说明 # 使用说明
## Hbuilderx(ps:因HBuilderX经常会更新,如无必要请勿更新HBuilderX为2.7.5及以上) ## Hbuilderx
- 目前已知 HBuilderX v2.7.5 版本不支持 :class 里面写 object 和 arraw - 已支持HBuilderX最新版
## 小程序安装步骤 ## 小程序安装步骤
- 先从私服上clone下来项目 - 先从私服上clone下来项目
@ -13,12 +13,14 @@
- uni会自动打开微信开发者工具并且打开uni的项目 - uni会自动打开微信开发者工具并且打开uni的项目
## 注意事项 ## 注意事项
- 目前并不支持H5运行,需要运行H5模式的,请自行调整兼容
- manifest.json 中可以配置uni项目的一些信息 - manifest.json 中可以配置uni项目的一些信息
- 打开manifest.json可配置小程序的 appid - 打开manifest.json可配置小程序的 appid
- 由于需要兼容app,公共样式由 main.js 迁移到了 App.vue,公共样式请在App.vue中进行编辑 - 由于需要兼容app,公共样式由 main.js 迁移到了 App.vue,公共样式请在App.vue中进行编辑
- 由于需要兼容app,尺寸单位由之前的rem改为rpx,由于修改样式工作量太大并且容易出错,已将.css更改为.less并在其中以之前rem的单位*100,获得新的rpx单位 - 由于需要兼容app,尺寸单位由之前的rem改为rpx,由于修改样式工作量太大并且容易出错,已将.css更改为.less并在其中以之前rem的单位*100,获得新的rpx单位
- 如需修改样式问题,请编辑.less的文件,请勿编辑.css的文件 - 如需修改样式问题,请编辑.less的文件,请勿编辑.css的文件
## 声明 ## 声明
- app测试版已上,请通过 `https://www.pgyer.com/yRYf` 安装测试。 - app测试版已上,请通过 `https://www.pgyer.com/yRYf` 安装测试。
- 运行app项目ios需要安装xcode,安卓需要装安卓的sdk以及安卓模拟器,建议安卓安装genymotion https://www.genymotion.com/ 登录时可选择私人使用,勾选后无需付费 - 运行app项目ios需要安装xcode,安卓需要装安卓的sdk以及安卓模拟器,建议安卓安装genymotion https://www.genymotion.com/ 登录时可选择私人使用,勾选后无需付费

2
components/GoodList.vue

@ -20,7 +20,7 @@
</view> </view>
</view> </view>
</view> </view>
<view class="iconfont icon-gouwuche cart-color acea-row row-center-wrapper"></view> <!-- <view class="iconfont icon-gouwuche cart-color acea-row row-center-wrapper"></view> -->
</view> </view>
</view> </view>
</template> </template>

55
pages/user/Recharge/index.vue

@ -28,7 +28,10 @@
<text class="pic-number"></text> <text class="pic-number"></text>
</text> </text>
</view> </view>
<view class="pic-number" v-if="item.value.give_price > 0">赠送{{ item.value.give_price }} </view> <view
class="pic-number"
v-if="item.value.give_price > 0"
>赠送{{ item.value.give_price }} </view>
</view> </view>
<!-- <view <!-- <view
class="pic-box pic-box-color acea-row row-center-wrapper" class="pic-box pic-box-color acea-row row-center-wrapper"
@ -40,7 +43,7 @@
v-model="money" v-model="money"
class="pic-box-money pic-number-pic" class="pic-box-money pic-number-pic"
/> />
</view> --> </view>-->
</view> </view>
<view class="tip">提示充值后帐户的金额不能提现</view> <view class="tip">提示充值后帐户的金额不能提现</view>
<view class="pay-btn bg-color-red" @click="recharge">立即充值</view> <view class="pay-btn bg-color-red" @click="recharge">立即充值</view>
@ -58,7 +61,7 @@ export default {
name: "Recharge", name: "Recharge",
components: {}, components: {},
props: {}, props: {},
data: function() { data: function () {
return { return {
active: 0, active: 0,
from: this.$deviceType, from: this.$deviceType,
@ -68,12 +71,11 @@ export default {
activePic: 0, activePic: 0,
numberPic: "", numberPic: "",
paid_price: "", paid_price: "",
rechar_id: 0 rechar_id: 0,
}; };
}, },
computed: mapGetters(["userInfo"]), computed: mapGetters(["userInfo"]),
mounted: function() { mounted: function () {
this.now_money = this.userInfo.nowMoney; this.now_money = this.userInfo.nowMoney;
this.getRecharge(); this.getRecharge();
}, },
@ -83,7 +85,7 @@ export default {
*/ */
getRecharge() { getRecharge() {
getRechargeApi() getRechargeApi()
.then(res => { .then((res) => {
this.picList = res.data.recharge_price_ways || []; this.picList = res.data.recharge_price_ways || [];
if (this.picList[0]) { if (this.picList[0]) {
this.rechar_id = this.picList[0].id; this.rechar_id = this.picList[0].id;
@ -91,12 +93,12 @@ export default {
this.numberPic = this.picList[0].value.give_price; this.numberPic = this.picList[0].value.give_price;
} }
}) })
.catch(res => { .catch((res) => {
uni.showToast({ uni.showToast({
title: title:
err.msg || err.response.data.msg || err.response.data.message, err.msg || err.response.data.msg || err.response.data.message,
icon: "none", icon: "none",
duration: 2000 duration: 2000,
}); });
}); });
}, },
@ -116,21 +118,28 @@ export default {
this.numberPic = item.value.price; this.numberPic = item.value.price;
} }
}, },
recharge: function() { recharge: function () {
let that = this, let that = this,
price = Number(this.money); price = Number(this.money);
if (this.picList.length == this.activePic && price === 0) { if (this.picList.length == this.activePic && price === 0) {
uni.showToast({ uni.showToast({
title: "请输入您要充值的金额", title: "请输入您要充值的金额",
icon: "none", icon: "none",
duration: 2000 duration: 2000,
}); });
return; return;
} else if (this.picList.length == this.activePic && price < 0.01) { } else if (this.picList.length == this.activePic && price < 0.01) {
uni.showToast({ uni.showToast({
title: "充值金额不能低于0.01", title: "充值金额不能低于0.01",
icon: "none", icon: "none",
duration: 2000 duration: 2000,
});
return;
} else if (this.picList.length == this.activePic && price > 99999) {
uni.showToast({
title: "充值金额不能大于99999",
icon: "none",
duration: 2000,
}); });
return; return;
} }
@ -147,9 +156,9 @@ export default {
price: prices, price: prices,
from: that.from, from: that.from,
paid_price: paid_price, paid_price: paid_price,
rechar_id: that.rechar_id rechar_id: that.rechar_id,
}) })
.then(res => { .then((res) => {
console.log(res); console.log(res);
var data = res.data.data; var data = res.data.data;
weappPay(res.data.data) weappPay(res.data.data)
@ -159,37 +168,37 @@ export default {
uni.showToast({ uni.showToast({
title: "支付成功", title: "支付成功",
icon: "success", icon: "success",
duration: 2000 duration: 2000,
}); });
this.$yrouter.back(); this.$yrouter.back();
}) })
.finally(res => { .finally((res) => {
//if(typeof(res) == "undefined") return //if(typeof(res) == "undefined") return
uni.showToast({ uni.showToast({
title: res, title: res,
icon: "none", icon: "none",
duration: 2000 duration: 2000,
}); });
}) })
.catch(function() { .catch(function () {
uni.showToast({ uni.showToast({
title: "支付失败", title: "支付失败",
icon: "none", icon: "none",
duration: 2000 duration: 2000,
}); });
}); });
}) })
.catch(err => { .catch((err) => {
console.log(err); console.log(err);
uni.showToast({ uni.showToast({
title: title:
err.msg || err.response.data.msg || err.response.data.message, err.msg || err.response.data.msg || err.response.data.message,
icon: "none", icon: "none",
duration: 2000 duration: 2000,
}); });
}); });
} },
} },
}; };
</script> </script>

Loading…
Cancel
Save