he2802 4 yıl önce
ebeveyn
işleme
5f392b89bf
6 değiştirilmiş dosya ile 127 ekleme ve 5 silme
  1. 7 1
      common/httpList/order.js
  2. 2 2
      common/request.js
  3. 1 1
      components/home.vue
  4. 1 1
      components/my.vue
  5. 9 0
      pages.json
  6. 107 0
      pages2/coin/index.vue

+ 7 - 1
common/httpList/order.js

@@ -9,5 +9,11 @@ export default {
 			data: data
 		})
 	},
-	
+	orderSmallCoin(data) {
+		return myRequest({
+			url: '/order/smallCoin',
+			method: 'post',
+			data: data
+		})
+	}
 }

+ 2 - 2
common/request.js

@@ -1,6 +1,6 @@
-//const BASE_URL = 'http://192.168.1.222:8088'
+const BASE_URL = 'http://192.168.1.222:8088'
 //const BASE_URL = 'http://127.0.0.1:8088' 
-const BASE_URL = 'https://api.xyyxt.net' 
+//const BASE_URL = 'https://api.xyyxt.net' 
 import store from '@/store/index.js'
 import api from './api.js'
 var num = 1

+ 1 - 1
components/home.vue

@@ -303,7 +303,7 @@ export default {
 			this.$api.advertisingList().then(res => {
 				let index;
 				for (index in res.data.rows ) {
-				  res.data.rows[index].image = res.data.rows[index].adverUrl
+				  res.data.rows[index].image = self.$method.splitImgHost(res.data.rows[index].adverUrl)
 				}
 				self.list = res.data.rows
 			});

+ 1 - 1
components/my.vue

@@ -30,7 +30,7 @@
 						</navigator>
 					</u-col>
 					<u-col span="4" text-align="center">
-						<navigator url="/pages2/wd/collect" hover-class="none">
+						<navigator url="/pages2/coin/index"  hover-class="none">
 							<view class="head_t1">金币</view>
 							<view class="head_t2">{{ userInfo.money }}</view>
 						</navigator>

+ 9 - 0
pages.json

@@ -262,6 +262,15 @@
 						"bounce": "none"
 					}
 				}
+			}, {
+				"path": "coin/index",
+				"style": {
+					"navigationBarTitleText": "我的金币",
+					"app-plus": {
+						"titleNView": false, //禁用原生导航栏 
+						"bounce": "none"
+					}
+				}
 			}
 		],
 		"plugins": {

+ 107 - 0
pages2/coin/index.vue

@@ -0,0 +1,107 @@
+<template>
+	<view class="content">
+		<u-cell-group>
+				<u-cell-item icon="integral" title="我的金币" :value="userInfo.money" :arrow="false"></u-cell-item>
+				<u-cell-item icon="integral" hover-class="cell-hover-class" title="特惠100金币" :value-style="{'color':'#FFCC00'}" value="¥0.01" :arrow="false" @click="pay(0.01)"></u-cell-item>
+				<u-cell-item icon="integral" hover-class="cell-hover-class" title="10金币" :value-style="{'color':'#FFCC00'}" value="¥10" :arrow="false" @click="pay(10)">></u-cell-item>
+				<u-cell-item icon="integral" hover-class="cell-hover-class" title="100金币" :value-style="{'color':'#FFCC00'}" value="¥100" :arrow="false" @click="pay(100)"></u-cell-item>
+				<u-cell-item icon="integral" hover-class="cell-hover-class" title="200金币" :value-style="{'color':'#FFCC00'}" value="¥200" :arrow="false" @click="pay(200)"></u-cell-item>
+				<u-cell-item icon="integral" hover-class="cell-hover-class" title="500金币" :value-style="{'color':'#FFCC00'}" value="¥500" :arrow="false" @click="pay(500)"></u-cell-item>
+			</u-cell-group>
+			
+	</view>
+</template>
+
+<script>
+import { mapGetters } from 'vuex';
+	export default {
+		data() {
+			return {
+				pdfh5: null
+			}
+		},
+		onLoad(option) {
+			this.$api.refreshUserInfo() 
+			
+		},
+		computed: {...mapGetters(['userInfo'])},
+		onShow(){
+		},
+		methods: {
+			pay(money){ 
+				if(uni.getSystemInfoSync().platform== 'ios'){
+					uni.showModal({
+						title: '提示',
+						content: 'IOS用户前往公众号充值',
+						showCancel: false
+					});
+					return
+				}
+				let that = this;
+				let list = []
+				list.push({goodsPrice:money,num:1})
+				let order = {goodsList:list};
+				this.$api.orderSmallCoin(order).then(
+					res => {
+						let objarr = res.data.data
+						wx.requestPayment({
+							timeStamp: objarr.timeStamp,
+							nonceStr: objarr.nonceStr,
+							package: objarr.package,
+							signType: objarr.signType,
+							paySign: objarr.sign,
+							success (result) {
+								uni.showModal({
+								    title: '提示',
+								    content: '支付成功',
+									showCancel: false,
+								    success: function (resst) {
+										if(resst.confirm){
+										that.$api.refreshUserInfo() 
+										}
+								    }
+								});
+							},
+							fail (err){
+								uni.showModal({
+								    title: '提示',
+								    content: '支付失败',
+									showCancel: false,
+								    success: function (resst) {
+										
+								    }
+								});
+							}
+						})
+					},
+					err => {
+						console.log(err);
+					}
+				);
+				
+			}
+			
+		}
+
+	}
+</script>
+
+<style scope>
+.cell-hover-class {
+	opacity: 0.5;
+}
+* {
+  padding: 0;
+  margin: 0;
+}
+html,
+body,
+#app {
+  width: 100%;
+  height: 100%;
+}
+page{
+	height: 100%;
+	
+}
+</style>