| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299 |
- <template>
- <view class="content">
- <!-- 支付成功 -->
- <view class="pay-box">
- <!-- <text class="success-icon iconfont iconroundcheck"></text> -->
- <image src="https://tmp01.kktv6.com/img/success.png" class="success-icon"></image>
- <text class="tit">支付成功</text>
- <view class="btn-group flex">
- <navigator url="/pages/order/order?state=1" open-type="redirect" class="mix-btn">查看订单</navigator>
- <navigator url="/pages/index/index" open-type="switchTab" class="mix-btn hollow">返回首页</navigator>
- <!-- <navigator v-if="showpink" url="/pages/delegation/delegation?state=0" open-type="redirect" class="mix-btn hollow">查看我的团</navigator> -->
- <!-- <navigator v-if="showpink" :url="'/pages/product/details?pink_id=' + (pinkId || '')" open-type="redirect" class="mix-btn hollow">马上分享</navigator> -->
- <!-- <navigator v-if="showauto" :url="'/pages/product/product?type=2&id=' + Autoid" open-type="redirect" class="mix-btn hollow">马上分享</navigator> -->
- </view>
- <!-- <view class="warn">安全提醒:平台及商家不会以订单异常系统升级为由要 求你点击任何网址链接进行退款操作</view> -->
- </view>
- <!-- 猜你喜欢 -->
- <!-- <view class="like-box">
- <view class="line"></view>
- <view class="like-tit">猜你喜欢</view>
- <view class="line"></view>
- </view> -->
- <!-- 商品内容 -->
- <!-- <scroll-view scroll-y class="cate-list" @scrolltolower="getProducts">
- <view class="guess-section">
- <view v-for="(item, index) in goodsList" :key="index" class="guess-item" @click="navToDetailPage(item)">
- <view class="image-wrapper">
- <image :src="item.image" mode="aspectFill"></image>
- </view>
- <text class="title clamp margin-c-20">{{ item.store_name }}</text>
- <view class="cmy-hr"></view>
- <view class="price margin-c-20 flex">
- <view>
- <text class="font-size-sm ">¥</text>
- {{ item.price }}
- </view>
- <view class="font-size-sm">
- <text class="font-color-gray">{{ item.sales }}人购买</text>
- </view>
- </view>
- </view>
- </view>
- </scroll-view> -->
- </view>
- </template>
- <script>
- import { getProducts } from '@/api/product.js';
- import { orderDetail } from '@/api/order.js';
- export default {
- data() {
- return {
- goodsList: [],
- limit: 6, //每次加载数据条数
- page: 1, //当前页数
- loadingType: 'more', //加载更多状态
- goodsDetail: {},
- showpink: false ,//判断是否显示拼团
- showauto: false, // 是否显示分享按钮
- Autoid: '', // 拼团商品id
- pinkId: 0, //
- };
- },
- onLoad(op) {
- if (op.newGoods ) {
- this.showpink = true;
- }
- if (op.pinkId) {
- this.pinkId = op.pinkId;
- // uni.navigateTo({
- // url: '/pages/product/details?pink_id=' + (this.pinkId || '')
- // });
- }
- // if (op.autoid ) {
- // this.Autoid = op.autoid;
- // this.showauto = true;
- // }
- // this.getProducts();
- },
- //下拉刷新
- onPullDownRefresh() {
- // 重置当前页面
- this.page = 1;
- // 加载商品
- // this.getProducts('refresh');
- },
- methods: {
- // 加载商品
- async getProducts(type, loading) {
- let obj = this;
- //没有更多直接返回
- if (type !== 'refresh') {
- if (obj.loadingType === 'nomore') {
- return;
- } else {
- obj.loadingType = 'loading';
- }
- } else {
- obj.loadingType = 'more';
- }
- let data = {
- page: obj.page,
- limit: obj.limit,
- news: obj.newOrder,
- keyword: this.keyword,
- mer_id: this.shopId
- };
- getProducts(data).then(e => {
- if (type === 'refresh') {
- obj.goodsList = [];
- }
- obj.goodsList = obj.goodsList.concat(e.data);
- //判断是否还有下一页,有是more 没有是nomore
- if (obj.limit == e.data.length) {
- obj.page++;
- obj.loadingType = 'more';
- } else {
- obj.loadingType = 'nomore';
- }
- if (type === 'refresh') {
- if (loading == 1) {
- uni.hideLoading();
- } else {
- uni.stopPullDownRefresh();
- }
- }
- });
- },
- navToDetailPage(item) {
- //测试数据没有写id,用title代替
- let id = item.id;
- uni.navigateTo({
- url: '/pages/product/product?id=' + id
- });
- }
- }
- };
- </script>
- <style lang="scss">
- .content{
- width: 100%;
- height: 100Vh;
- background-color: #FFFFFF;
- }
- .pay-box {
- width: 100%;
- // height: 100vh;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- background: rgba(255, 255, 255, 1);
- .success-icon {
- font-size: 96rpx;
- color: #5dbc7c;
- margin-top: 40rpx;
- width: 96rpx;
- height: 96rpx;
- }
- .tit {
- font-size: 38rpx;
- color: #303133;
- height: 34px;
- font-family: PingFangSC;
- font-weight: 500;
- color: rgba(51, 51, 51, 1);
- line-height: 56px;
- &.price {
- font-size: 42rpx;
- }
- }
- .btn-group {
- padding-top: 40rpx;
- display: flex;
- width: 100%;
- padding-right: 40rpx;
- padding-left: 40rpx;
- justify-content: space-around;
- .mix-btn {
- width: 180rpx;
- height: 60rpx;
- background: rgba(255, 255, 255, 1);
- border: 1px solid rgba(204, 204, 204, 1);
- border-radius: 6rpx;
- margin-top: 30upx;
- display: flex;
- align-items: center;
- justify-content: center;
- font-size: $font-lg;
- color: #333333;
- &.hollow {
- background: #fff;
- color: #666666;
- }
- }
- }
- .warn {
- font-size: 28rpx;
- font-weight: 500;
- color: rgba(249, 174, 41, 1);
- line-height: 40rpx;
- padding: 40rpx;
- }
- }
- /* 猜你喜欢标题 */
- .like-box {
- display: flex;
- align-items: center;
- height: 77rpx;
- justify-content: center;
- .line {
- width: 46rpx;
- height: 2rpx;
- background: linear-gradient(to right, rgba(255, 255, 255, 1), rgba(153, 153, 153, 1));
- &:last-of-type {
- background: linear-gradient(to right, rgba(153, 153, 153, 1), rgba(255, 255, 255, 1));
- }
- }
- .like-tit {
- font-size: 28rpx;
- font-weight: 500;
- color: rgba(63, 69, 75, 1);
- line-height: 55rpx;
- margin: 0 14rpx;
- }
- }
- .guess-section {
- display: flex;
- flex-wrap: wrap;
- padding: 0 24rpx;
- .guess-item {
- overflow: hidden;
- display: flex;
- flex-direction: column;
- width: 48%;
- margin-bottom: 4%;
- border-radius: $border-radius-sm;
- background-color: white;
- box-shadow: $box-shadow;
- &:nth-child(2n + 1) {
- margin-right: 3%;
- }
- }
- .image-wrapper {
- width: 100%;
- height: 330rpx;
- border-radius: 3px;
- overflow: hidden;
- image {
- width: 100%;
- height: 100%;
- opacity: 1;
- }
- }
- .title {
- font-size: $font-base;
- color: $font-color-dark;
- font-weight: bold;
- line-height: 80rpx;
- overflow: hidden;
- text-overflow: ellipsis;
- }
- .price {
- font-size: $font-lg;
- /* color: $font-color-base; */
- font-weight: bold;
- line-height: 1;
- line-height: 80rpx;
- color: rgba(252, 65, 65, 1);
- }
- /* .icon {
- @extend %icon;
- } */
- .detail {
- line-height: 1;
- }
- .tip {
- color: white;
- background-color: $color-yellow;
- line-height: 1.5;
- font-size: $font-sm;
- padding-left: 20rpx;
- }
- }
- </style>
|