123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370 |
- <template>
- <view class="index-content" :style="{'--status-bar-': statusBarHeight}">
- <view class="index-content-info">
- <!-- 头部主要内容 开始 -->
- <view class="index-content-header">
- <customNavbar
- title="全民分享"
- bgColor="rgba(0,0,0,0)"
- :is-left="false"
- :customNavbarInfo='{}'>
- <view slot="right">
- <image @click="getRetailQrcode()" style="width: 44rpx;height: 44rpx;" :src="fengxiang" mode=""></image>
- </view>
- </customNavbar>
- <u-search
- @clickIcon="navigateToFun('/pages/index/search')"
- @custom="navigateToFun('/pages/index/search')"
- @focus="navigateToFun('/pages/index/search')"
- :showAction="true"
- bgColor="#fff"
- actionText="搜索">
-
- </u-search>
- </view>
- <!-- 头部主要内容 结束 -->
-
- <!-- 列表主要内容 开始 -->
-
- <view class="index-content-list">
- <customScrollList
- ref="customScrollList"
- @load="load"
- @paging="paging"
- @refresh="refresh"
- >
- <view class="index-content-list-info" v-if="retailIndex.length>0">
- <text class="index-content-list-class">剧目</text>
- <view
- class="index-content-list-item"
- v-for="(item,index) in retailIndex"
- :key="index">
-
- <view class="index-content-list-content">
- <image
- class="index-content-list-image"
- :src="item.showImg" mode="scaleToFill"></image>
- <view class="index-content-list-tool">
- <text class="index-content-list-title">{{ item.name }}</text>
- <text
- class="index-content-list-but"
- @click="navigateToFun('/pages/publicSharingDetails/index',{ performId: item.id})"
- >查看</text>
- </view>
- </view>
- </view>
- </view>
- </customScrollList>
- </view>
- <!-- 列表主要内容 结束 -->
- </view>
- <!-- 我的分享码 -->
- <customPromotionCode ref="customPromotionCode" />
- <!-- 入网认证 -->
- <u-modal
- :show="show"
- :title="title1"
- :content='content'
- cancelText='取消'
- :confirmText='confirmText'
- showCancelButton
- confirmColor='#ED0000'
- @confirm='networkConfirm'
- @cancel='networkCancel'
- @close='networkCancel'
- ></u-modal>
- </view>
- </template>
- <script>
- import {
- navigateTo
- } from "@/utils/util.js"
- export default {
- data() {
- return {
- title: '全民分享',
- loading: false,
- statusBarHeight: 0, // 状态栏安全距离
- retailIndex: [], // 剧目列表
- fengxiang: this.$commonConfig.staticUrl+'index/fengxiang.png',
-
- // 入网认证
- isShowQrcode: -1, // 是否展示 推广码
- show: false,
- title1:'入网提示',
- content:'你还未进行银联支付入网签约认证,请先完成签约认证!',
- confirmText: '去认证',
- }
- },
- onLoad() {
-
- },
- onShow() {
- this.statusBarHeight = getApp().globalData.statusBarHeight
- //this.load()
- },
- methods: {
- async load(paging){
- console.log("上拉 加载数据")
- try{
- let res = await this.$u.api.retailIndex({
- "page": paging.page,
- "pages": paging.size,
- })
- if(res && res.code ===200) {
- if(res.data.performList){
- this.retailIndex = this.retailIndex.concat(res.data.performList)
- }else {
- this.retailIndex = []
- }
- this.$refs.customScrollList.loadSuccess({
- list: this.retailIndex,
- total: this.retailIndex.length
- })
- } else {
- this.$refs.customScrollList.loadSuccess({
- list: [],
- total: 0
- })
- }
- }catch(e){
- //TODO handle the exception
- console.error("e===",e)
- this.$refs.customScrollList.loadSuccess({
- list: [],
- total: 0
- })
- }
- },
- paging(){
- console.log("下拉 加载数据")
- },
- /**
- * 下拉触底
- */
- async refresh(paging){
- console.log("上拉 加载数据",this.retailIndex)
- //this.$refs.customScrollList.showEmpty = true
- try{
- //this.$refs.customScrollList.showPullUp = true
- let res = await this.$u.api.retailIndex({
- pageNum: paging.page,
- pageSize: paging.size
- })
- if(res && res.code ===200) {
- if(res.data.performList){
- this.retailIndex = [].concat(res.data.performList)
- }else {
- this.retailIndex = []
- }
- // this.retailIndex = null
- this.$refs.customScrollList.refreshSuccess({
- list: this.retailIndex,
- total: this.retailIndex.length
- })
- } else {
- this.$refs.customScrollList.refreshSuccess({
- list: [],
- total: 0
- })
- }
- }catch(e){
- //TODO handle the exception
- console.error("e===",e)
- this.$refs.customScrollList.refreshSuccess({
- list: [],
- total: 0
- })
- }
- },
- /**
- * @author ygh
- * @data 2023-12-20
- */
- navigateToFun(url,data={}) {
- console.log("dsffd",data)
- navigateTo(url,data)
- },
- /**
- * 我的推广码
- */
- async getRetailQrcode(){
- try{
- await this.getUserInfo()
- if(this.isShowQrcode != 1) {
- if(this.isShowQrcode == 0) {
- this.content = '你还未进行银联支付入网签约认证,请先完成签约认证!'
- this.confirmText = '去认证'
- }else if(this.isShowQrcode == 2) {
- this.content = '银联支付入网签约认证中,请耐心等待!'
- this.confirmText = '去查看'
- }else if(this.isShowQrcode == 3) {
- this.content = '银联支付入网签约认证失败,请重新认证!'
- this.confirmText = '重新认证'
- }
- this.show = true
- }else {
- let res = await this.$u.api.getRetailQrcode({
- noSign: 1,
- userid: this.distribution_user_info.userId
- })
-
- if(res && res.code ===200) {
- this.$refs.customPromotionCode.initData(res.data)
- // #ifdef H5
- //window.history.pushState(null, null, document.URL)
- // #endif
- }
- }
-
- }catch(e){
- //TODO handle the exception
- console.error("e===",e)
- }
- },
-
- /** 入网认证 */
- networkConfirm() {
- this.show = false
- this.navigateToFun('/pages/networkAuth/index')
- //this.getUnionAccessUrlFun()
- },
- networkCancel() {
- this.show = false
- },
- /**
- * 获取用户信息
- */
- async getUserInfo() {
- try{
- let res = await this.$u.api.getInfo({
- noSign: 1,
- userid: this.distribution_user_info.userId
- })
- if(res && res.code ===200) {
- this.isShowQrcode = res.data.unionFlag
- }
- }catch(e){
- //TODO handle the exception
- console.error("e===",e)
- this.isShowQrcode = -1
- }
- },
- /** 银联签约入网地址 */
- async getUnionAccessUrlFun(){
- try{
- let res = await this.$u.api.getUnionAccessUrl({
- userid: this.distribution_user_info.userId
- })
-
- if(res && res.code ===200) {
- this.show = false
- location.href = res.data.jumpUrl
- } else {
- this.show = true
- }
- }catch(e){
- //TODO handle the exception
- this.show = true
- console.error("e===",e)
- }
- }
- }
- }
- </script>
- <style lang="scss" scoped>
- .index-content {
- display: flex;
- flex-direction: column;
- align-items: center;
- justify-content: center;
- box-sizing: border-box;
-
- --header-h: 170rpx;
- // background-color:
- .index-content-info {
- width: 100%;
- box-sizing: border-box;
- }
- }
- /** 头部主要内容 开始 */
- .index-content-header {
- width: 100%;
- height: var(--header-h);
- box-sizing: border-box;
- background-color: var(--gd-bgm-color);
- ::v-deep .u-search {
- padding: 0 30rpx !important;
- }
- ::v-deep .u-search__action {
- color: #fff !important;
- }
- }
- /** 头部主要内容 结束 **/
-
-
- /** 列表主要内容 开始 */
- .index-content-list {
- width: 100%;
- height: calc( 100% - var(--header-h) - var(--status-bar-h) );
- }
-
- .index-content-list-info {
- width: 100%;
- box-sizing: border-box;
- padding: 32rpx 32rpx 150rpx;
- .index-content-list-class {
- font-size: 32rpx;
- font-family: SourceHanSansCN, SourceHanSansCN;
- font-weight: bold;
- color: #2D2D2D;
- }
- .index-content-list-item {
- width: 100%;
- box-sizing: border-box;
- background: #FFFFFF;
- box-shadow: 0rpx 2rpx 20rpx 0rpx rgba(200,200,200,0.5);
- border-radius: 24rpx;
- overflow: hidden;
- margin-top: 40rpx;
- .index-content-list-content {
- width: 100%;
- box-sizing: border-box;
- .index-content-list-image {
- width: 100%;
- height: 242rpx;
- }
- .index-content-list-tool {
- display: flex;
- width: 100%;
- justify-content: space-between;
- align-items: center;
- padding:42rpx 28rpx 46rpx;
- box-sizing: border-box;
- .index-content-list-title {
- font-size: 28rpx;
- font-family: SourceHanSansCN, SourceHanSansCN;
- font-weight: bold;
- color: #363636;
- }
- .index-content-list-but {
- width: 160rpx;
- height: 51rpx;
- background: #ED0000;
- border-radius: 24rpx;
- font-size: 20rpx;
- font-family: PingFangSC, PingFang SC;
- font-weight: 400;
- color: #FFFFFF;
- display: flex;
- justify-content: center;
- align-items: center;
- }
- }
- }
- }
- }
- /** 列表主要内容 结束 **/
- </style>
|