1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- <template>
- <div class="page-yahtzee">
- <div class="box-shop-wrap">
- <div class="box-shop">
- <h1>商城</h1>
- <ul class="list-gold">
- <li class="gold-item" v-for="(item,index) in shopList" :key="index" @click="handlePay(item.id,1)">
- <div class="item-bd">
- <img :src="item.icon" alt="">
- <p>¥{{item.price/100}}</p>
- </div>
- <div class="item-ft">获取 <img src="@/img/yahtzee/icon_coin.png" alt=""><em>{{item.name}}</em></div>
- </li>
- </ul>
- </div>
- </div>
- </div>
- </template>
- <script>
- import lib from 'lib'
- import axios from 'axios'
- import {Indicator, Toast, MessageBox} from 'mint-ui';
- import pay from 'pay';
- export default {
- data () {
- return {
- picUrl: lib.domain+"/build/img/taptapstar/",
- appid: lib.getParam('dwAppId'),
- selectIndex:1,
- shopList : [], //推荐列表
- tradeNo: "", //小游戏支付交易的订单号
- }
- },
- mounted () {
- this.getGoodsInfo();
- },
- methods:{
- getGoodsInfo(){
- let url = `${lib.apiUrl}/product/${this.appid}/products/${this.selectIndex}`;
- axios.get(url,{
- dwAppId : this.appid,
- type : this.selectIndex
- }).then(({data}) => {
- console.log(data.data.list)
- this.shopList = data.data.list;
- });
- },
- handlePay(productId,productCount=1){
- pay.handlePay(productId,productCount);
- }
- },
- }
- </script>
- <style lang="scss">
- @import "./scss/yahtzee.scss";
- </style>
|