Commit 6a6f8fe5 by sunchao

轮播图组件化

parent 87f2b601
<template>
<view class="banner">
<view class="uni-margin-wrap">
<swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
:duration="duration">
<swiper-item v-for="bannerItem in carouselList">
<navigator url="bannerItem.destinationAddress"><image :src="bannerItem.filePath" mode="widthFix"></image></navigator>
</swiper-item>
</swiper>
</view>
</view>
</template>
<script>
export default{
props:['carouselList'],
data(){
return {
indicatorDots: true,
autoplay: true,
interval: 2000,
duration: 500,
}
},
name:'carousel',
components:{},
onLoad(){
console.log(this.fileUploadItemList)
},
methods:{
}
}
</script>
<style lang="scss">
</style>
\ No newline at end of file
......@@ -64,10 +64,8 @@
},
"ad" : {},
"payment" : {
"weixin" : {
"__platform__" : [ "ios", "android" ],
"appid" : "wxec09b9be6cff4eb3",
"UniversalLinks" : ""
"alipay" : {
"__platform__" : [ "ios", "android" ]
}
},
"oauth" : {
......
<template>
<view>
<view :class="{pad:onlyShowList!=0}">
<carousel :carouselList="fileUploadItemCFFPList" v-if="onlyShowList!=0"></carousel>
<h4 v-if="cffpCourseInfos.length<=0" class="noListTip">暂无课程列表</h4>
<view class="ulBox" v-if="cffpCourseInfos.length>0">
<view class="liBox" v-for="item in cffpCourseInfos" :key="item.fileId" @click="goDetail(item)">
......@@ -7,27 +8,31 @@
</view>
</view>
</view>
<tabBar :currentPage="currentPage" v-if="fromPage!='index'"></tabBar>
<tabBar :currentPage="currentPage" v-if="onlyShowList!=0"></tabBar>
</template>
<script>
import api from "../../api/api";
import courseItem from "@/components/courseItem/courseItem.vue";
import tabBar from '../../components/tabBar/tabBar.vue';
import carousel from '@/components/carousel/carousel.vue'
export default{
props:['tagIds','fromPage'],
props:['tagIds','onlyShowList'],
data(){
return{
cffpCourseInfos:[],
currentPage:'courselist'
currentPage:'courselist',
fileUploadItemCFFPList:[]
}
},
name:'courselist',
components:{
courseItem,
tabBar
tabBar,
carousel
},
onLoad(){
this.fileUploadItemCFFPList = uni.getStorageSync('fileUploadItemCFFPList');
},
methods:{
goDetail(item){
......@@ -76,5 +81,7 @@
margin-bottom: 10rpx;
padding: 10rpx;
}
.pad{
padding:0 30rpx 100rpx 30rpx;
}
</style>
\ No newline at end of file
......@@ -8,20 +8,12 @@
</view>
<view class="search">
<input class="searchInput" type="text" name="" id="" />
<text class="iconfont icon-sousuo"></text>
<text class="iconfont icon-sousuo" @click="searchBtn()"></text>
<text class="iconfont icon-xiaoxi"></text>
<text class="system_msg" @click="jumpToSystemMsg()">{{messageUnreadCount}}</text>
</view>
<view class="banner">
<view class="uni-margin-wrap">
<swiper class="swiper" circular :indicator-dots="indicatorDots" :autoplay="autoplay" :interval="interval"
:duration="duration">
<swiper-item v-for="bannerItem in cffpUserInfo.fileUploadItemList">
<navigator url="bannerItem.destinationAddress"><image :src="bannerItem.filePath" mode="widthFix"></image></navigator>
</swiper-item>
</swiper>
</view>
</view>
<!--轮播组件-->
<carousel :carouselList="cffpUserInfo.fileUploadItemList"></carousel>
</view>
<view class="message" @click="jumpToAnnouncement()">
<view style="display: flex;align-items: center;">
......@@ -48,7 +40,7 @@
<h4>精品课程</h4>
<view @click="goToCourselist()">更多<text class="iconfont icon-youjiantou"></text></view>
</view>
<courselist :tagIds="[1111]" :fromPage="'index'"></courselist>
<courselist :tagIds="[1111]" :onlyShowList="0"></courselist>
</view>
<tabBar :currentPage="currentPage"></tabBar>
</view>
......@@ -63,6 +55,7 @@
import courselist from '@/pages/courselist/courselist.vue';
import api from "../../api/api";
import tabBar from '../../components/tabBar/tabBar.vue';
import carousel from '@/components/carousel/carousel.vue';
export default {
data() {
return {
......@@ -84,20 +77,17 @@
name:'',
type:''//类型1,区域中心,2工作室
},
background: ['color1', 'color2', 'color3'],
indicatorDots: true,
autoplay: true,
interval: 2000,
duration: 500,
announcementInfo:null,
messageUnreadCount:null,
tagIds:123,
currentPage:'index',
carouselList:[]
}
},
components:{
courselist,
tabBar
tabBar,
carousel
},
onLoad() {
this.queryAreaCenterInfo();
......@@ -125,6 +115,7 @@
if(res['success']){
this.cffpUserInfo = res['data'];
// this.cffpUserInfo.logo = res['logo'];
uni.setStorageSync('fileUploadItemCFFPList',this.cffpUserInfo['fileUploadItemCFFPList'])
}else{
uni.showToast({
title: res['message'],
......@@ -170,6 +161,9 @@
uni.navigateTo({
url:'../../pages/courselist/courselist'
})
},
searchBtn(){
}
},
onShow() {
......@@ -210,8 +204,6 @@
margin: 30rpx auto;
align-items: center;
.searchInput{
height: 50rpx;
line-height: 50rpx;
border-radius: 60rpx;
width: 95%;
background: linear-gradient(to right,#E6F5FC,#FDE9F2);
......@@ -222,7 +214,7 @@
font-size: 60rpx;
position: absolute;
right: 80rpx;
top: 14rpx;
top: 10rpx;
opacity: .7;
}
.icon-xiaoxi{
......
......@@ -153,17 +153,27 @@
methods: {
// 支付
pay(){
if(this.paymentMethod===1){
const param = {
orderId:this.orderId,
amount:this.totalPrice,
paymentMethod:this.paymentMethod,
userId:this.userId
}
api.wxAppPay(param).then(res=>{
console.log(res)
})
// if(this.paymentMethod===1){
// const param = {
// orderId:this.orderId,
// amount:this.totalPrice,
// paymentMethod:this.paymentMethod,
// userId:this.userId
// }
// api.wxAppPay(param).then(res=>{
// console.log(res)
// })
// }
uni.requestPayment({
provider: 'alipay',
orderInfo: 'alipay_root_cert_sn=687b59193f3f462dd5336e5abf83c5d8_02941eef3187dddf3d3b83462e1dfcf6&alipay_sdk=alipay-sdk-java-dynamicVersionNo&app_cert_sn=f974d178cb6bd0cd2c4e3dca07825e92&app_id=2021003161624312&biz_content=%7B%22out_trade_no%22%3A%22YD2022101000001%22%2C%22product_code%22%3A%22FACE_TO_FACE_PAYMENT%22%2C%22subject%22%3A%22%E6%88%91%E6%98%AF%E6%B5%8B%E8%AF%95%E6%95%B0%E6%8D%AE%22%2C%22total_amount%22%3A%220.00%22%7D&charset=UTF-8&format=json&method=alipay.trade.app.pay&notify_url=https%3A%2F%2Fmdev.zuihuibi.cn%2Fapi%2Fpay%2FwxPayNotify&sign=RyxnIM9pBC4V4sfFXZc2ksb0nwRWtbJjQQ%2BzNOJ083AA0rl%2BP206AWerCJatS2D%2BWUjarSc8nZXfqbJ9CX0xZwWoDv6QelM5SOZmzcnPUyh4i3H8K6tj6fo2eFbv%2Bn%2F7Mep%2BfXmepAfArzzxedoSLnwIN%2Bp%2Fsiw6c%2Fkg4asBIoT4g%2FRHjdgMuycm%2B5zOGOGvzzGA2DOuD%2F8mnsnGSgu0gRGMXY9PfPNPULRKPosHw4%2Bc%2BkWzcKvy2j7izUGcGscixNdtbwjQVrfS2jrsVoVc6OCmKGGJEklIRG%2F3SWnyoIPCwO42KAbJOtb6vxZ0C8a7wvo%2B%2BBtRjZ2%2Fqv7SGZexWA%3D%3D&sign_type=RSA2&timestamp=2022-11-18+09%3A32%3A58&version=1.0', //支付宝订单数据
success: function (res) {
alert('success:' + JSON.stringify(res));
},
fail: function (err) {
alert('fail:' + JSON.stringify(err));
}
});
},
// 积分查询
queryByUserIdFortuneStatistic(){
......
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