123
@ -1,409 +1,442 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<view style="background-color: #EBF4F7;letter-spacing: 1rpx;">
 | 
			
		||||
		<tn-nav-bar :isBack="false" :bottomShadow="true" backgroundColor="#FFFFFF">
 | 
			
		||||
			<view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left">
 | 
			
		||||
				<view style="text-shadow:  1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;width: 100%;">
 | 
			
		||||
					<!-- <tn-tabs :list="[{name:'智慧云商协'}]" :current="topCurrent" activeColor="#000" :bold="false"
 | 
			
		||||
  <view style="background-color: rgb(235, 244, 247);">
 | 
			
		||||
    <tn-nav-bar :isBack="false" :bottomShadow="true" backgroundColor="#FFFFFF">
 | 
			
		||||
      <view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left">
 | 
			
		||||
        <view style="text-shadow:  1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;width: 100%;">
 | 
			
		||||
          <!-- <tn-tabs :list="[{name:'智慧云商协'}]" :current="topCurrent" activeColor="#000" :bold="false"
 | 
			
		||||
            :fontSize="36"></tn-tabs> -->
 | 
			
		||||
					<view style="text-align: center;font-size: 36rpx;" @click="selectShow = true">
 | 
			
		||||
						<text>{{HomeTitle}}</text>
 | 
			
		||||
						<!--						<image src="/static/c1455.png" style="width: 25rpx;height: 25rpx;margin-left: 10rpx;"></image>-->
 | 
			
		||||
					</view>
 | 
			
		||||
				</view>
 | 
			
		||||
			</view>
 | 
			
		||||
		</tn-nav-bar>
 | 
			
		||||
		<view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
 | 
			
		||||
			<view class="tn-flex tn-flex-center tn-flex-col-center tn-flex-row-between" style="padding-top: 30rpx;">
 | 
			
		||||
				<view class="tn-color-gray--dark"
 | 
			
		||||
					style="width: 100%;margin: 0rpx 30rpx 0 30rpx;border-radius: 100rpx;padding-left: 6rpx;background-color: #ffffff;"
 | 
			
		||||
					@click="openUrl('/pages/index/search/search')">
 | 
			
		||||
					<tn-notice-bar :list="searlist" mode="vertical" leftIconName="search"
 | 
			
		||||
						:duration="6000"></tn-notice-bar>
 | 
			
		||||
				</view>
 | 
			
		||||
				<view class="tn-flex" style="margin:0px 30rpx;">
 | 
			
		||||
					<image @click="openUrl('/pages/index/my_assist')" src="/static/t1.png"
 | 
			
		||||
						style="width: 35rpx;height: 35rpx;"></image>
 | 
			
		||||
					<view style="position: relative;">
 | 
			
		||||
						<image @click="openUrl('/pages/index/my_msg')" src="/static/t2.png"
 | 
			
		||||
							style="width: 35rpx;height: 35rpx;margin-left: 40rpx;"></image>
 | 
			
		||||
						<tn-badge v-if="msg()>0" style="position: absolute;top: -20rpx;right: -20rpx;" backgroundColor="#E83A30"
 | 
			
		||||
							fontColor="#ffffff">{{msg()}}</tn-badge>
 | 
			
		||||
					</view>
 | 
			
		||||
				</view>
 | 
			
		||||
			</view>
 | 
			
		||||
          <view style="text-align: center;font-size: 32rpx;" @click="selectShow = true">
 | 
			
		||||
            <text>{{ HomeTitle }}</text>
 | 
			
		||||
            <!--						<image src="/static/c1455.png" style="width: 25rpx;height: 25rpx;margin-left: 10rpx;"></image>-->
 | 
			
		||||
          </view>
 | 
			
		||||
        </view>
 | 
			
		||||
      </view>
 | 
			
		||||
    </tn-nav-bar>
 | 
			
		||||
    <view :style="{paddingTop: vuex_custom_bar_height + 'px'}">
 | 
			
		||||
      <view class="tn-flex tn-flex-center tn-flex-col-center tn-flex-row-between" style="padding-top: 30rpx;">
 | 
			
		||||
        <view class="tn-color-gray--dark"
 | 
			
		||||
              style="width: 100%;margin: 0rpx 30rpx 0 30rpx;border-radius: 100rpx;padding-left: 6rpx;background-color: #ffffff;"
 | 
			
		||||
              @click="openUrl('/pages/index/search/search')">
 | 
			
		||||
          <tn-notice-bar :list="searlist" mode="vertical" leftIconName="search"
 | 
			
		||||
                         :duration="6000"></tn-notice-bar>
 | 
			
		||||
        </view>
 | 
			
		||||
        <view class="tn-flex" style="margin:0px 30rpx 0rpx 0rpx;">
 | 
			
		||||
          <tn-button backgroundColor="#ffffff" fontColor="#666666" shape="round" width="140rpx" height="70rpx">搜索
 | 
			
		||||
          </tn-button>
 | 
			
		||||
 | 
			
		||||
			<swiper class="card-swiper" current="0" :circular="true" duration="500" interval="8000"
 | 
			
		||||
				@change="cardSwiper">
 | 
			
		||||
				<swiper-item v-for="(item,index) in carousel_list" :key="index" :class="cardCur==index?'cur':''">
 | 
			
		||||
					<video v-if="item.type==2" id="myVideo" :src="apiImgUrl+item.image" :controls="false" loop autoplay
 | 
			
		||||
						object-fit="contain" style="width: 100%;border-radius: 15rpx;height: 100%;"
 | 
			
		||||
						@error="videoErrorCallback"></video>
 | 
			
		||||
					<image v-if="item.type==1" :src="apiImgUrl+item.image" mode="aspectFit"
 | 
			
		||||
						style="width: 100%;    height: 100%;border-radius: 15rpx;">
 | 
			
		||||
					</image>
 | 
			
		||||
				</swiper-item>
 | 
			
		||||
			</swiper>
 | 
			
		||||
			<view class="indication">
 | 
			
		||||
				<block v-for="(item,index) in carousel_list" :key="index">
 | 
			
		||||
					<view class="spot" :class="cardCur==index?'active':''"></view>
 | 
			
		||||
				</block>
 | 
			
		||||
			</view>
 | 
			
		||||
		</view>
 | 
			
		||||
		<view class="tn-flex tn-flex-row-between tn-flex-col-center tn-flex-row-center"
 | 
			
		||||
			style="padding:0px 30rpx 0rpx 30rpx;text-align: center;font-size: 28rpx;">
 | 
			
		||||
			<view @click="openUrl('/pages/index/tissue')"
 | 
			
		||||
				style="width: 33%;background: linear-gradient(270deg, #3CBAEA, #6BC7F0);;border-radius: 16rpx;padding:25rpx 20rpx;">
 | 
			
		||||
				<view>
 | 
			
		||||
					<image src="/static/c3.png" style="width: 35rpx;height: 35rpx;vertical-align: middle;">
 | 
			
		||||
					</image>
 | 
			
		||||
				</view>
 | 
			
		||||
				<view style="margin-top: 10rpx;">
 | 
			
		||||
					<text style="color: #FFF;">组织架构</text>
 | 
			
		||||
				</view>
 | 
			
		||||
			</view>
 | 
			
		||||
			<view @click="openUrl('/pages/index/service')"
 | 
			
		||||
				style="width: 33%;background: linear-gradient(270deg, #EE7E45, #EE9657);border-radius: 16rpx;padding:25rpx 20rpx;margin-left:10rpx;">
 | 
			
		||||
				<view>
 | 
			
		||||
					<image src="/static/c2.png" style="width: 35rpx;height: 35rpx;vertical-align: middle;">
 | 
			
		||||
					</image>
 | 
			
		||||
				</view>
 | 
			
		||||
				<view style="margin-top: 10rpx;">
 | 
			
		||||
					<text style="color: #FFF;">协会活动</text>
 | 
			
		||||
				</view>
 | 
			
		||||
			</view>
 | 
			
		||||
			<view @click="openUrl('/pages/index/directory')"
 | 
			
		||||
				style="width: 33%;background: linear-gradient(270deg, #45B335, #89C33D);border-radius: 16rpx;padding:25rpx 20rpx;margin-left:10rpx;">
 | 
			
		||||
				<view>
 | 
			
		||||
					<image src="/static/c1.png" style="width: 35rpx;height: 35rpx;vertical-align: middle;">
 | 
			
		||||
					</image>
 | 
			
		||||
				</view>
 | 
			
		||||
				<view style="margin-top: 10rpx;">
 | 
			
		||||
					<text style="color: #FFF;">通讯录</text>
 | 
			
		||||
				</view>
 | 
			
		||||
          <!--					<image @click="openUrl('/pages/index/my_assist')" src="/static/t1.png"-->
 | 
			
		||||
          <!--						style="width: 35rpx;height: 35rpx;"></image>-->
 | 
			
		||||
          <!--					<view style="position: relative;">-->
 | 
			
		||||
          <!--						<image @click="openUrl('/pages/index/my_msg')" src="/static/t2.png"-->
 | 
			
		||||
          <!--							style="width: 35rpx;height: 35rpx;margin-left: 40rpx;"></image>-->
 | 
			
		||||
          <!--						<tn-badge v-if="msg()>0" style="position: absolute;top: -20rpx;right: -20rpx;"-->
 | 
			
		||||
          <!--							backgroundColor="#E83A30" fontColor="#ffffff">{{msg()}}</tn-badge>-->
 | 
			
		||||
          <!--					</view>-->
 | 
			
		||||
        </view>
 | 
			
		||||
      </view>
 | 
			
		||||
 | 
			
		||||
			</view>
 | 
			
		||||
			<!--			<view @click="openUrl('/pages/index/knowledge_list')"-->
 | 
			
		||||
			<!--				style="width: 25%;background-image: linear-gradient(135deg, #667eea 0%, #764ba2 100%);;border-radius: 16rpx;padding:35rpx 20rpx;margin-left:10rpx;">-->
 | 
			
		||||
			<!--				<view>-->
 | 
			
		||||
			<!--					<image src="/static/book.png" style="width: 35rpx;height: 35rpx;vertical-align: middle;">-->
 | 
			
		||||
			<!--					</image>-->
 | 
			
		||||
			<!--				</view>-->
 | 
			
		||||
			<!--				<view style="margin-top: 10rpx;">-->
 | 
			
		||||
			<!--					<text style="color: #FFF;">商学院</text>-->
 | 
			
		||||
			<!--				</view>-->
 | 
			
		||||
			<!--			</view>-->
 | 
			
		||||
		</view>
 | 
			
		||||
		<view @click.stop="openUrl('/pages/index/service')"
 | 
			
		||||
			class="tn-flex tn-flex-row-between tn-flex-col-center tn-flex-row-center" style="padding: 30rpx;">
 | 
			
		||||
			<view style="font-size: 36rpx;">协会活动</view>
 | 
			
		||||
			<view style="color: #808080;">
 | 
			
		||||
				<text>更多</text>
 | 
			
		||||
				<text class="tn-icon-right"></text>
 | 
			
		||||
			</view>
 | 
			
		||||
		</view>
 | 
			
		||||
		<view style="padding-bottom: 30rpx;">
 | 
			
		||||
			<scroll-view :scroll-x="true" style="padding:0rpx 30rpx;white-space: nowrap;" v-if="actList.length>0">
 | 
			
		||||
				<view v-for="(item,index) in actList" @click="openUrl('/pages/index/event_info?id='+item.id)"
 | 
			
		||||
					style="position: relative;;display: inline-block;width: 300rpx;text-align: center;background-color: #FFF;border-radius: 20rpx;overflow: hidden;margin-right: 20rpx;">
 | 
			
		||||
					<view>
 | 
			
		||||
						<image :src="apiImgUrl+item.activity_image" style="width: 350rpx;height: 170rpx;">
 | 
			
		||||
						</image>
 | 
			
		||||
					</view>
 | 
			
		||||
					<view style="padding:10rpx 20rpx;font-weight: 400;min-height: 100rpx;">
 | 
			
		||||
						<view class="tn-text-ellipsis-2" style="text-align: left;">
 | 
			
		||||
							<text>{{ item.activity_name }}</text>
 | 
			
		||||
						</view>
 | 
			
		||||
					</view>
 | 
			
		||||
					<view style="position: absolute;top: 10rpx;left: 10rpx;">
 | 
			
		||||
						<tn-button v-if="item.type=='进行中'" width="80rpx" height="40rpx" size="sm"
 | 
			
		||||
							backgroundColor="#6BC7F0 " fontColor="tn-color-white">进行中
 | 
			
		||||
						</tn-button>
 | 
			
		||||
						<tn-button v-if="item.type=='未开始'" width="80rpx" height="40rpx" size="sm"
 | 
			
		||||
							backgroundColor="#EE9556 " fontColor="tn-color-white">预告
 | 
			
		||||
						</tn-button>
 | 
			
		||||
						<tn-button v-if="item.type=='已结束'" width="80rpx" height="40rpx" size="sm"
 | 
			
		||||
							backgroundColor="#E12B33 " fontColor="tn-color-white">已结束
 | 
			
		||||
						</tn-button>
 | 
			
		||||
					</view>
 | 
			
		||||
				</view>
 | 
			
		||||
			</scroll-view>
 | 
			
		||||
			<view style="background-color: #ffffff;padding: 20rpx;text-align: center" v-if="actList.length==0">暂无活动
 | 
			
		||||
			</view>
 | 
			
		||||
		</view>
 | 
			
		||||
		<view style="background-color: #ffffff;">
 | 
			
		||||
			<tn-tabs :list="goryList" :isScroll="true" :activeItemStyle="{fontSize:'35rpx',fontWeight:'600'}"
 | 
			
		||||
				activeColor="#000000" :current="current" name="name" @change="change" :fontSize="28"></tn-tabs>
 | 
			
		||||
		</view>
 | 
			
		||||
		<view style="padding:10px 30rpx;padding-bottom: 100rpx;">
 | 
			
		||||
			<view v-for="(item,index) in news_list" class="tn-flex tn-flex-row-between"
 | 
			
		||||
				@click="openUrl('/pages/index/new_info?id='+item.news_id)"
 | 
			
		||||
				style="background-color: #ffffff;padding: 20rpx;border-radius: 10rpx;margin-bottom: 10rpx;">
 | 
			
		||||
				<view style="position:relative;">
 | 
			
		||||
					<view class="tn-text-ellipsis-2" style="font-size: 28rpx;">{{ item.news_title }}
 | 
			
		||||
					</view>
 | 
			
		||||
					<view class="tn-flex tn-flex-row-between"
 | 
			
		||||
						style="width: 100%;color: #808080;position: absolute; bottom: 0rpx; min-width: 380rpx;overflow: hidden">
 | 
			
		||||
						<view>{{ item.name }}</view>
 | 
			
		||||
						<view>
 | 
			
		||||
							<text class="tn-icon-eye" style="vertical-align: middle;"></text>
 | 
			
		||||
							<text style="vertical-align: middle;">{{ item.news_hits }}</text>
 | 
			
		||||
						</view>
 | 
			
		||||
					</view>
 | 
			
		||||
				</view>
 | 
			
		||||
				<view style="margin-left: 20rpx;" v-if="item.news_image">
 | 
			
		||||
					<image :src="apiImgUrl+item.news_image" mode="aspectFill"
 | 
			
		||||
						style="width: 240rpx;height: 160rpx;;border-radius: 10rpx;"></image>
 | 
			
		||||
				</view>
 | 
			
		||||
			</view>
 | 
			
		||||
		</view>
 | 
			
		||||
		<tn-select v-model="selectShow" mode="single" :list="selectList" @confirm="confirm"></tn-select>
 | 
			
		||||
	</view>
 | 
			
		||||
      <swiper class="card-swiper" style="height: 365rpx" current="0" mode="dot" :circular="true" duration="500"
 | 
			
		||||
              interval="8000"
 | 
			
		||||
              @change="cardSwiper">
 | 
			
		||||
        <swiper-item style="padding: 0px 28rpx;height: 380rpx" v-for="(item,index) in carousel_list" :key="index"
 | 
			
		||||
                     :class="cardCur==index?'cur':''">
 | 
			
		||||
          <video :muted="true" v-if="item.type==2" id="myVideo" :src="apiImgUrl+item.image" :controls="false"
 | 
			
		||||
                 loop autoplay object-fit="contain" style="width: 100%;border-radius: 15rpx;height: 100%;"
 | 
			
		||||
                 @error="videoErrorCallback"></video>
 | 
			
		||||
          <image v-if="item.type==1" :src="apiImgUrl+item.image" mode="aspectFit"
 | 
			
		||||
                 style="width: 100%;height: 380rpx;border-radius: 15rpx;">
 | 
			
		||||
          </image>
 | 
			
		||||
        </swiper-item>
 | 
			
		||||
      </swiper>
 | 
			
		||||
      <view class="indication">
 | 
			
		||||
        <block v-for="(item,index) in carousel_list" :key="index">
 | 
			
		||||
          <view class="spot" :class="cardCur==index?'active':''"></view>
 | 
			
		||||
        </block>
 | 
			
		||||
      </view>
 | 
			
		||||
    </view>
 | 
			
		||||
    <view class="tn-flex tn-flex-row-between tn-flex-col-center tn-flex-row-center" style="padding: 0px 28rpx;">
 | 
			
		||||
      <view
 | 
			
		||||
          style="position:relative;padding: 20rpx;border-radius: 16rpx;height: 270rpx;width: 100%;background: linear-gradient(275.57deg, rgba(193, 237, 217, 1) 1.39%, rgba(188, 237, 216, 1) 112.49%);">
 | 
			
		||||
        <view style="font-size: 30rpx">协会简介</view>
 | 
			
		||||
        <view style="font-size: 22rpx;margin-top: 10rpx">Association introduction</view>
 | 
			
		||||
        <image src="/static/48098165.png" style="width: 150rpx;height: 150rpx;position: absolute; right: 10rpx;bottom: 0;"></image>
 | 
			
		||||
      </view>
 | 
			
		||||
      <view style="width: 100%;margin-left: 20rpx">
 | 
			
		||||
        <view
 | 
			
		||||
            style=" position:relative;padding: 20rpx;border-radius: 16rpx;height: 130rpx;background: linear-gradient(280.64deg, rgba(251, 236, 198, 1) 0%, rgba(248, 225, 183, 1) 117.05%);">
 | 
			
		||||
          <view style="font-size: 30rpx">调查问卷</view>
 | 
			
		||||
          <view style="font-size: 22rpx;margin-top: 10rpx">Questionnaires</view>
 | 
			
		||||
          <image src="/static/48098160.png" style="width: 90rpx;height: 90rpx;position: absolute; right: 10rpx;bottom: 0;"></image>
 | 
			
		||||
        </view>
 | 
			
		||||
        <view
 | 
			
		||||
            style="position:relative;margin-top: 10rpx;padding: 20rpx;border-radius: 16rpx;height: 130rpx;background: linear-gradient(279.38deg, rgba(246, 217, 197, 1) -5.05%, rgba(245, 209, 189, 1) 121.63%);">
 | 
			
		||||
          <view style="font-size: 30rpx">公益捐赠</view>
 | 
			
		||||
          <view style="font-size: 22rpx;margin-top: 10rpx">Public donations</view>
 | 
			
		||||
          <image src="/static/48098162.png" style="width: 90rpx;height: 90rpx;position: absolute; right: 10rpx;bottom: 0;"></image>
 | 
			
		||||
        </view>
 | 
			
		||||
      </view>
 | 
			
		||||
    </view>
 | 
			
		||||
    <view class="tn-flex tn-flex-row-between tn-flex-col-center tn-flex-row-center" style="padding: 0px 28rpx;margin-top: 10rpx">
 | 
			
		||||
      <view
 | 
			
		||||
          style="position:relative;padding: 20rpx;border-radius: 16rpx;height: 130rpx;width: 100%;background: linear-gradient(96.63deg, rgba(189, 224, 249, 1) 11.78%, rgba(205, 233, 251, 1) 103.76%);">
 | 
			
		||||
        <view style="font-size: 30rpx">线下活动</view>
 | 
			
		||||
        <view style="font-size: 22rpx;margin-top: 10rpx">Offline events</view>
 | 
			
		||||
        <image src="/static/48098164.png" style="width: 90rpx;height: 90rpx;position: absolute; right: 10rpx;bottom: 0;"></image>
 | 
			
		||||
      </view>
 | 
			
		||||
      <view style="width: 100%;margin-left: 20rpx">
 | 
			
		||||
        <view
 | 
			
		||||
            style="position:relative;padding: 20rpx;border-radius: 16rpx;height: 130rpx;background: linear-gradient(96.63deg, rgba(226, 228, 245, 1) 11.78%, rgba(234, 236, 255, 1) 103.76%);">
 | 
			
		||||
          <view style="font-size: 30rpx">学习培训</view>
 | 
			
		||||
          <view style="font-size: 22rpx;margin-top: 10rpx">Learn and train</view>
 | 
			
		||||
          <image src="/static/48098163.png" style="width: 90rpx;height: 90rpx;position: absolute; right: 10rpx;bottom: 0;"></image>
 | 
			
		||||
        </view>
 | 
			
		||||
      </view>
 | 
			
		||||
    </view>
 | 
			
		||||
    <!--    <view class="tn-flex tn-flex-row-between tn-flex-col-center tn-flex-row-center"-->
 | 
			
		||||
    <!--          style="padding:0px 30rpx 0rpx 30rpx;text-align: center;font-size: 28rpx;">-->
 | 
			
		||||
    <!--      <view @click="openUrl('/pages/index/tissue')"-->
 | 
			
		||||
    <!--            style="width: 33%;background: linear-gradient(270deg, #3CBAEA, #6BC7F0);;border-radius: 16rpx;padding:25rpx 20rpx;">-->
 | 
			
		||||
    <!--        <view>-->
 | 
			
		||||
    <!--          <image src="/static/c3.png" style="width: 35rpx;height: 35rpx;vertical-align: middle;">-->
 | 
			
		||||
    <!--          </image>-->
 | 
			
		||||
    <!--        </view>-->
 | 
			
		||||
    <!--        <view style="margin-top: 10rpx;">-->
 | 
			
		||||
    <!--          <text style="color: #FFF;">组织架构</text>-->
 | 
			
		||||
    <!--        </view>-->
 | 
			
		||||
    <!--      </view>-->
 | 
			
		||||
    <!--      <view @click="openUrl('/pages/index/service')"-->
 | 
			
		||||
    <!--            style="width: 33%;background: linear-gradient(270deg, #EE7E45, #EE9657);border-radius: 16rpx;padding:25rpx 20rpx;margin-left:10rpx;">-->
 | 
			
		||||
    <!--        <view>-->
 | 
			
		||||
    <!--          <image src="/static/c2.png" style="width: 35rpx;height: 35rpx;vertical-align: middle;">-->
 | 
			
		||||
    <!--          </image>-->
 | 
			
		||||
    <!--        </view>-->
 | 
			
		||||
    <!--        <view style="margin-top: 10rpx;">-->
 | 
			
		||||
    <!--          <text style="color: #FFF;">协会活动</text>-->
 | 
			
		||||
    <!--        </view>-->
 | 
			
		||||
    <!--      </view>-->
 | 
			
		||||
    <!--      <view @click="openUrl('/pages/index/directory')"-->
 | 
			
		||||
    <!--            style="width: 33%;background: linear-gradient(270deg, #45B335, #89C33D);border-radius: 16rpx;padding:25rpx 20rpx;margin-left:10rpx;">-->
 | 
			
		||||
    <!--        <view>-->
 | 
			
		||||
    <!--          <image src="/static/c1.png" style="width: 35rpx;height: 35rpx;vertical-align: middle;">-->
 | 
			
		||||
    <!--          </image>-->
 | 
			
		||||
    <!--        </view>-->
 | 
			
		||||
    <!--        <view style="margin-top: 10rpx;">-->
 | 
			
		||||
    <!--          <text style="color: #FFF;">通讯录</text>-->
 | 
			
		||||
    <!--        </view>-->
 | 
			
		||||
 | 
			
		||||
    <!--      </view>-->
 | 
			
		||||
    <!--    </view>-->
 | 
			
		||||
    <view @click.stop="openUrl('/pages/index/service')"
 | 
			
		||||
          class="tn-flex tn-flex-row-between tn-flex-col-center tn-flex-row-center" style="padding: 30rpx;">
 | 
			
		||||
      <view style="font-size: 36rpx;">协会活动</view>
 | 
			
		||||
      <view style="color: #808080;">
 | 
			
		||||
        <text>更多</text>
 | 
			
		||||
        <text class="tn-icon-right"></text>
 | 
			
		||||
      </view>
 | 
			
		||||
    </view>
 | 
			
		||||
    <view style="padding-bottom: 30rpx;">
 | 
			
		||||
      <scroll-view :scroll-x="true" style="padding:0rpx 30rpx;white-space: nowrap;" v-if="actList.length>0">
 | 
			
		||||
        <view v-for="(item,index) in actList" @click="openUrl('/pages/index/event_info?id='+item.id)"
 | 
			
		||||
              style="position: relative;;display: inline-block;width: 300rpx;text-align: center;background-color: #FFF;border-radius: 20rpx;overflow: hidden;margin-right: 20rpx;">
 | 
			
		||||
          <view>
 | 
			
		||||
            <image :src="apiImgUrl+item.activity_image" style="width: 350rpx;height: 170rpx;">
 | 
			
		||||
            </image>
 | 
			
		||||
          </view>
 | 
			
		||||
          <view style="padding:10rpx 20rpx;font-weight: 400;min-height: 100rpx;">
 | 
			
		||||
            <view class="tn-text-ellipsis-2" style="text-align: left;">
 | 
			
		||||
              <text>{{ item.activity_name }}</text>
 | 
			
		||||
            </view>
 | 
			
		||||
          </view>
 | 
			
		||||
          <view style="position: absolute;top: 10rpx;left: 10rpx;">
 | 
			
		||||
            <tn-button v-if="item.type=='进行中'" width="80rpx" height="40rpx" size="sm"
 | 
			
		||||
                       backgroundColor="#6BC7F0 " fontColor="tn-color-white">进行中
 | 
			
		||||
            </tn-button>
 | 
			
		||||
            <tn-button v-if="item.type=='未开始'" width="80rpx" height="40rpx" size="sm"
 | 
			
		||||
                       backgroundColor="#EE9556 " fontColor="tn-color-white">预告
 | 
			
		||||
            </tn-button>
 | 
			
		||||
            <tn-button v-if="item.type=='已结束'" width="80rpx" height="40rpx" size="sm"
 | 
			
		||||
                       backgroundColor="#E12B33 " fontColor="tn-color-white">已结束
 | 
			
		||||
            </tn-button>
 | 
			
		||||
          </view>
 | 
			
		||||
        </view>
 | 
			
		||||
      </scroll-view>
 | 
			
		||||
      <view style="background-color: #ffffff;padding: 20rpx;text-align: center" v-if="actList.length==0">暂无活动
 | 
			
		||||
      </view>
 | 
			
		||||
    </view>
 | 
			
		||||
    <view style="background-color: #ffffff;">
 | 
			
		||||
      <tn-tabs :list="goryList" :isScroll="true" :activeItemStyle="{fontSize:'35rpx',fontWeight:'600'}"
 | 
			
		||||
               activeColor="#000000" :current="current" name="name" @change="change" :fontSize="28"></tn-tabs>
 | 
			
		||||
    </view>
 | 
			
		||||
    <view style="padding:10px 30rpx;padding-bottom: 100rpx;">
 | 
			
		||||
      <view v-for="(item,index) in news_list" class="tn-flex tn-flex-row-between"
 | 
			
		||||
            @click="openUrl('/pages/index/new_info?id='+item.news_id)"
 | 
			
		||||
            style="background-color: #ffffff;padding: 20rpx;border-radius: 10rpx;margin-bottom: 10rpx;">
 | 
			
		||||
        <view style="position:relative;">
 | 
			
		||||
          <view class="tn-text-ellipsis-2" style="font-size: 28rpx;">{{ item.news_title }}
 | 
			
		||||
          </view>
 | 
			
		||||
          <view class="tn-flex tn-flex-row-between"
 | 
			
		||||
                style="width: 100%;color: #808080;position: absolute; bottom: 0rpx; min-width: 380rpx;overflow: hidden">
 | 
			
		||||
            <view>{{ item.name }}</view>
 | 
			
		||||
            <view>
 | 
			
		||||
              <text class="tn-icon-eye" style="vertical-align: middle;"></text>
 | 
			
		||||
              <text style="vertical-align: middle;">{{ item.news_hits }}</text>
 | 
			
		||||
            </view>
 | 
			
		||||
          </view>
 | 
			
		||||
        </view>
 | 
			
		||||
        <view style="margin-left: 20rpx;" v-if="item.news_image">
 | 
			
		||||
          <image :src="apiImgUrl+item.news_image" mode="aspectFill"
 | 
			
		||||
                 style="width: 240rpx;height: 160rpx;;border-radius: 10rpx;"></image>
 | 
			
		||||
        </view>
 | 
			
		||||
      </view>
 | 
			
		||||
    </view>
 | 
			
		||||
    <tn-select v-model="selectShow" mode="single" :list="selectList" @confirm="confirm"></tn-select>
 | 
			
		||||
  </view>
 | 
			
		||||
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
	import {
 | 
			
		||||
		newsGoryList,
 | 
			
		||||
		activityList,
 | 
			
		||||
		newsList,
 | 
			
		||||
		associationIndex,
 | 
			
		||||
		carouselIndex,
 | 
			
		||||
		Mailcoent
 | 
			
		||||
	} from '@/util/api.js';
 | 
			
		||||
	import store from '@/store/index.js'
 | 
			
		||||
import {
 | 
			
		||||
  newsGoryList,
 | 
			
		||||
  activityList,
 | 
			
		||||
  newsList,
 | 
			
		||||
  associationIndex,
 | 
			
		||||
  carouselIndex,
 | 
			
		||||
  Mailcoent
 | 
			
		||||
} from '@/util/api.js';
 | 
			
		||||
import store from '@/store/index.js'
 | 
			
		||||
 | 
			
		||||
	export default {
 | 
			
		||||
		data() {
 | 
			
		||||
			return {
 | 
			
		||||
				selectShow: false,
 | 
			
		||||
				selectList: [],
 | 
			
		||||
				topCurrent: 0,
 | 
			
		||||
				searlist: [
 | 
			
		||||
					'企业家名称/公司名称',
 | 
			
		||||
				],
 | 
			
		||||
				cardCur: 0,
 | 
			
		||||
				isAndroid: true,
 | 
			
		||||
				goryList: [],
 | 
			
		||||
				news_list: [],
 | 
			
		||||
				actList: [],
 | 
			
		||||
				carousel_list: [],
 | 
			
		||||
				current: 0,
 | 
			
		||||
				page: 1,
 | 
			
		||||
				size: 10,
 | 
			
		||||
				gory_id: 0,
 | 
			
		||||
				type: 1,
 | 
			
		||||
				HomeTitle: '',
 | 
			
		||||
				apiImgUrl: this.$store.state.imgUrl
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		mounted() {
 | 
			
		||||
			getApp().getUserLogin((r) => {
 | 
			
		||||
				console.log('---Login---', r);
 | 
			
		||||
			})
 | 
			
		||||
			this.getNewsGoryList();
 | 
			
		||||
			this.getActivityList();
 | 
			
		||||
			this.getAssociationIndex();
 | 
			
		||||
			this.getCarouselIndex();
 | 
			
		||||
			this.getMsg();
 | 
			
		||||
		},
 | 
			
		||||
		methods: {
 | 
			
		||||
      msg() {
 | 
			
		||||
        return this.$store.state.msgCount;
 | 
			
		||||
      },
 | 
			
		||||
      async getMsg() {
 | 
			
		||||
				var uid = uni.getStorageSync('uid');
 | 
			
		||||
export default {
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      selectShow: false,
 | 
			
		||||
      selectList: [],
 | 
			
		||||
      topCurrent: 0,
 | 
			
		||||
      searlist: [
 | 
			
		||||
        '企业家名称/公司名称',
 | 
			
		||||
      ],
 | 
			
		||||
      cardCur: 0,
 | 
			
		||||
      isAndroid: true,
 | 
			
		||||
      goryList: [],
 | 
			
		||||
      news_list: [],
 | 
			
		||||
      actList: [],
 | 
			
		||||
      carousel_list: [],
 | 
			
		||||
      current: 0,
 | 
			
		||||
      page: 1,
 | 
			
		||||
      size: 10,
 | 
			
		||||
      gory_id: 0,
 | 
			
		||||
      type: 1,
 | 
			
		||||
      HomeTitle: '',
 | 
			
		||||
      apiImgUrl: this.$store.state.imgUrl
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    getApp().getUserLogin((r) => {
 | 
			
		||||
      console.log('---Login---', r);
 | 
			
		||||
    })
 | 
			
		||||
    this.getNewsGoryList();
 | 
			
		||||
    this.getActivityList();
 | 
			
		||||
    this.getAssociationIndex();
 | 
			
		||||
    this.getCarouselIndex();
 | 
			
		||||
    this.getMsg();
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    msg() {
 | 
			
		||||
      return this.$store.state.msgCount;
 | 
			
		||||
    },
 | 
			
		||||
    async getMsg() {
 | 
			
		||||
      var uid = uni.getStorageSync('uid');
 | 
			
		||||
 | 
			
		||||
        const res = await Mailcoent({
 | 
			
		||||
          member_id: uid
 | 
			
		||||
        });
 | 
			
		||||
        console.log(res);
 | 
			
		||||
        if (res.code == 1) {
 | 
			
		||||
          this.$store.commit('$tStore', {
 | 
			
		||||
            name: 'msgCount',
 | 
			
		||||
            value: res.data
 | 
			
		||||
      const res = await Mailcoent({
 | 
			
		||||
        member_id: uid
 | 
			
		||||
      });
 | 
			
		||||
      console.log(res);
 | 
			
		||||
      if (res.code == 1) {
 | 
			
		||||
        this.$store.commit('$tStore', {
 | 
			
		||||
          name: 'msgCount',
 | 
			
		||||
          value: res.data
 | 
			
		||||
        })
 | 
			
		||||
      } else {
 | 
			
		||||
        this.$store.commit('$tStore', {
 | 
			
		||||
          name: 'msgCount',
 | 
			
		||||
          value: 0
 | 
			
		||||
        })
 | 
			
		||||
      }
 | 
			
		||||
      console.log(store.state.msgCount);
 | 
			
		||||
    },
 | 
			
		||||
    confirm(d) {
 | 
			
		||||
      var info = d[0];
 | 
			
		||||
      store.commit('$tStore', {
 | 
			
		||||
        name: 'Gid',
 | 
			
		||||
        value: info.value
 | 
			
		||||
      })
 | 
			
		||||
      uni.setStorageSync('Gid', info.value);
 | 
			
		||||
      this.page = 1;
 | 
			
		||||
      this.goryList = [];
 | 
			
		||||
      this.news_list = [];
 | 
			
		||||
      this.actList = [];
 | 
			
		||||
      this.carousel_list = [];
 | 
			
		||||
      this.getNewsGoryList();
 | 
			
		||||
      this.getActivityList();
 | 
			
		||||
      this.getAssociationIndex();
 | 
			
		||||
      this.getCarouselIndex();
 | 
			
		||||
      //this.$emit('childEvent', '修改后的数据');
 | 
			
		||||
    },
 | 
			
		||||
    getAssociationIndex() {
 | 
			
		||||
      associationIndex()
 | 
			
		||||
          .then(res => {
 | 
			
		||||
            console.log(res);
 | 
			
		||||
            if (res.code == 1) {
 | 
			
		||||
              var key = res.data;
 | 
			
		||||
              const transformedSelectList = key.map(item => ({
 | 
			
		||||
                value: item.id,
 | 
			
		||||
                label: item.association_name,
 | 
			
		||||
                icon: item.association_image
 | 
			
		||||
              }));
 | 
			
		||||
              const foundNumber = transformedSelectList.find((element) => element.value == store.state
 | 
			
		||||
                  .Gid);
 | 
			
		||||
              this.HomeTitle = foundNumber.label;
 | 
			
		||||
              this.selectList = transformedSelectList;
 | 
			
		||||
              //#ifdef MP-WEIXIN
 | 
			
		||||
              this.$parent.childEvent(foundNumber);
 | 
			
		||||
              //#endif
 | 
			
		||||
              // #ifdef  H5
 | 
			
		||||
              console.log('H5');
 | 
			
		||||
              this.$parent.$parent.$parent.$parent.childEvent(foundNumber);
 | 
			
		||||
              // #endif
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
        } else {
 | 
			
		||||
          this.$store.commit('$tStore', {
 | 
			
		||||
            name: 'msgCount',
 | 
			
		||||
            value: 0
 | 
			
		||||
          .catch(error => {
 | 
			
		||||
            uni.showToast({
 | 
			
		||||
              title: error,
 | 
			
		||||
              icon: 'none',
 | 
			
		||||
              duration: 2000
 | 
			
		||||
            });
 | 
			
		||||
          })
 | 
			
		||||
        }
 | 
			
		||||
        console.log(store.state.msgCount);
 | 
			
		||||
			},
 | 
			
		||||
			confirm(d) {
 | 
			
		||||
				var info = d[0];
 | 
			
		||||
				store.commit('$tStore', {
 | 
			
		||||
					name: 'Gid',
 | 
			
		||||
					value: info.value
 | 
			
		||||
				})
 | 
			
		||||
				uni.setStorageSync('Gid', info.value);
 | 
			
		||||
				this.page = 1;
 | 
			
		||||
				this.goryList = [];
 | 
			
		||||
				this.news_list = [];
 | 
			
		||||
				this.actList = [];
 | 
			
		||||
				this.carousel_list = [];
 | 
			
		||||
				this.getNewsGoryList();
 | 
			
		||||
				this.getActivityList();
 | 
			
		||||
				this.getAssociationIndex();
 | 
			
		||||
				this.getCarouselIndex();
 | 
			
		||||
				//this.$emit('childEvent', '修改后的数据');
 | 
			
		||||
			},
 | 
			
		||||
			getAssociationIndex() {
 | 
			
		||||
				associationIndex()
 | 
			
		||||
					.then(res => {
 | 
			
		||||
						console.log(res);
 | 
			
		||||
						if (res.code == 1) {
 | 
			
		||||
							var key = res.data;
 | 
			
		||||
							const transformedSelectList = key.map(item => ({
 | 
			
		||||
								value: item.id,
 | 
			
		||||
								label: item.association_name,
 | 
			
		||||
								icon: item.association_image
 | 
			
		||||
							}));
 | 
			
		||||
							const foundNumber = transformedSelectList.find((element) => element.value == store.state
 | 
			
		||||
								.Gid);
 | 
			
		||||
							this.HomeTitle = foundNumber.label;
 | 
			
		||||
							this.selectList = transformedSelectList;
 | 
			
		||||
							//#ifdef MP-WEIXIN
 | 
			
		||||
							this.$parent.childEvent(foundNumber);
 | 
			
		||||
							//#endif
 | 
			
		||||
							// #ifdef  H5
 | 
			
		||||
							console.log('H5');
 | 
			
		||||
							this.$parent.$parent.$parent.$parent.childEvent(foundNumber);
 | 
			
		||||
							// #endif
 | 
			
		||||
						}
 | 
			
		||||
					})
 | 
			
		||||
					.catch(error => {
 | 
			
		||||
						uni.showToast({
 | 
			
		||||
							title: error,
 | 
			
		||||
							icon: 'none',
 | 
			
		||||
							duration: 2000
 | 
			
		||||
						});
 | 
			
		||||
					})
 | 
			
		||||
			},
 | 
			
		||||
			getCarouselIndex() {
 | 
			
		||||
				carouselIndex({
 | 
			
		||||
						association_id: store.state.Gid,
 | 
			
		||||
					})
 | 
			
		||||
					.then(res => {
 | 
			
		||||
						console.log(res);
 | 
			
		||||
						if (res.code == 1) {
 | 
			
		||||
							this.carousel_list = res.data;
 | 
			
		||||
						}
 | 
			
		||||
					})
 | 
			
		||||
					.catch(error => {
 | 
			
		||||
						uni.showToast({
 | 
			
		||||
							title: error,
 | 
			
		||||
							icon: 'none',
 | 
			
		||||
							duration: 2000
 | 
			
		||||
						});
 | 
			
		||||
					})
 | 
			
		||||
			},
 | 
			
		||||
			getActivityList() {
 | 
			
		||||
				activityList({
 | 
			
		||||
						association_id: store.state.Gid,
 | 
			
		||||
						page: 1,
 | 
			
		||||
						size: 5
 | 
			
		||||
					})
 | 
			
		||||
					.then(res => {
 | 
			
		||||
						console.log(res);
 | 
			
		||||
						if (res.code == 1) {
 | 
			
		||||
							this.actList = res.data.ret;
 | 
			
		||||
						} else {
 | 
			
		||||
							this.actList = [];
 | 
			
		||||
						}
 | 
			
		||||
					})
 | 
			
		||||
					.catch(error => {
 | 
			
		||||
						uni.showToast({
 | 
			
		||||
							title: error,
 | 
			
		||||
							icon: 'none',
 | 
			
		||||
							duration: 2000
 | 
			
		||||
						});
 | 
			
		||||
					})
 | 
			
		||||
			},
 | 
			
		||||
			getNewsGoryList() {
 | 
			
		||||
				newsGoryList({
 | 
			
		||||
						association_id: store.state.Gid
 | 
			
		||||
					})
 | 
			
		||||
					.then(res => {
 | 
			
		||||
						console.log(res);
 | 
			
		||||
						if (res.code == 1) {
 | 
			
		||||
							var key = res.data;
 | 
			
		||||
							key.unshift({
 | 
			
		||||
								id: 0,
 | 
			
		||||
								name: '最新'
 | 
			
		||||
							});
 | 
			
		||||
							this.goryList = key;
 | 
			
		||||
							this.type = 1;
 | 
			
		||||
							this.gory_id = 0;
 | 
			
		||||
							this.getNewsList();
 | 
			
		||||
						}
 | 
			
		||||
					})
 | 
			
		||||
					.catch(error => {
 | 
			
		||||
						uni.showToast({
 | 
			
		||||
							title: error,
 | 
			
		||||
							icon: 'none',
 | 
			
		||||
							duration: 2000
 | 
			
		||||
						});
 | 
			
		||||
					})
 | 
			
		||||
			},
 | 
			
		||||
			getNewsList() {
 | 
			
		||||
				newsList({
 | 
			
		||||
						association_id: store.state.Gid,
 | 
			
		||||
						type: this.type,
 | 
			
		||||
						gory_id: this.gory_id,
 | 
			
		||||
						page: this.page,
 | 
			
		||||
						size: this.size
 | 
			
		||||
					})
 | 
			
		||||
					.then(res => {
 | 
			
		||||
						console.log(res);
 | 
			
		||||
						if (res.code == 1) {
 | 
			
		||||
							this.news_list.push(...res.data.ret);
 | 
			
		||||
						}
 | 
			
		||||
					})
 | 
			
		||||
					.catch(error => {
 | 
			
		||||
						uni.showToast({
 | 
			
		||||
							title: error,
 | 
			
		||||
							icon: 'none',
 | 
			
		||||
							duration: 2000
 | 
			
		||||
						});
 | 
			
		||||
					})
 | 
			
		||||
			},
 | 
			
		||||
			cardSwiper(d) {
 | 
			
		||||
				this.cardCur = d.detail.current;
 | 
			
		||||
			},
 | 
			
		||||
			ReachBottom() {
 | 
			
		||||
				console.log('home');
 | 
			
		||||
				this.page = this.page + 1;
 | 
			
		||||
				this.getNewsList();
 | 
			
		||||
				//this.getIndex();
 | 
			
		||||
			},
 | 
			
		||||
			change(e) {
 | 
			
		||||
				this.current = e;
 | 
			
		||||
				var info = this.goryList[e];
 | 
			
		||||
				this.gory_id = info.id;
 | 
			
		||||
				this.type = e === 0 ? 1 : 0;
 | 
			
		||||
				this.page = 1;
 | 
			
		||||
				this.news_list = [];
 | 
			
		||||
				this.getNewsList();
 | 
			
		||||
			},
 | 
			
		||||
			openUrl(url) {
 | 
			
		||||
				uni.navigateTo({
 | 
			
		||||
					url: url
 | 
			
		||||
				})
 | 
			
		||||
			},
 | 
			
		||||
			opentab() {
 | 
			
		||||
				uni.$emit('depId', {
 | 
			
		||||
					index: 1
 | 
			
		||||
				})
 | 
			
		||||
			},
 | 
			
		||||
			videoErrorCallback: function(e) {
 | 
			
		||||
				uni.showModal({
 | 
			
		||||
					content: e.target.errMsg,
 | 
			
		||||
					showCancel: false
 | 
			
		||||
				})
 | 
			
		||||
			},
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
    },
 | 
			
		||||
    getCarouselIndex() {
 | 
			
		||||
      carouselIndex({
 | 
			
		||||
        association_id: store.state.Gid,
 | 
			
		||||
      })
 | 
			
		||||
          .then(res => {
 | 
			
		||||
            console.log(res);
 | 
			
		||||
            if (res.code == 1) {
 | 
			
		||||
              this.carousel_list = res.data;
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
          .catch(error => {
 | 
			
		||||
            uni.showToast({
 | 
			
		||||
              title: error,
 | 
			
		||||
              icon: 'none',
 | 
			
		||||
              duration: 2000
 | 
			
		||||
            });
 | 
			
		||||
          })
 | 
			
		||||
    },
 | 
			
		||||
    getActivityList() {
 | 
			
		||||
      activityList({
 | 
			
		||||
        association_id: store.state.Gid,
 | 
			
		||||
        page: 1,
 | 
			
		||||
        size: 5
 | 
			
		||||
      })
 | 
			
		||||
          .then(res => {
 | 
			
		||||
            console.log(res);
 | 
			
		||||
            if (res.code == 1) {
 | 
			
		||||
              this.actList = res.data.ret;
 | 
			
		||||
            } else {
 | 
			
		||||
              this.actList = [];
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
          .catch(error => {
 | 
			
		||||
            uni.showToast({
 | 
			
		||||
              title: error,
 | 
			
		||||
              icon: 'none',
 | 
			
		||||
              duration: 2000
 | 
			
		||||
            });
 | 
			
		||||
          })
 | 
			
		||||
    },
 | 
			
		||||
    getNewsGoryList() {
 | 
			
		||||
      newsGoryList({
 | 
			
		||||
        association_id: store.state.Gid
 | 
			
		||||
      })
 | 
			
		||||
          .then(res => {
 | 
			
		||||
            console.log(res);
 | 
			
		||||
            if (res.code == 1) {
 | 
			
		||||
              var key = res.data;
 | 
			
		||||
              key.unshift({
 | 
			
		||||
                id: 0,
 | 
			
		||||
                name: '最新'
 | 
			
		||||
              });
 | 
			
		||||
              this.goryList = key;
 | 
			
		||||
              this.type = 1;
 | 
			
		||||
              this.gory_id = 0;
 | 
			
		||||
              this.getNewsList();
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
          .catch(error => {
 | 
			
		||||
            uni.showToast({
 | 
			
		||||
              title: error,
 | 
			
		||||
              icon: 'none',
 | 
			
		||||
              duration: 2000
 | 
			
		||||
            });
 | 
			
		||||
          })
 | 
			
		||||
    },
 | 
			
		||||
    getNewsList() {
 | 
			
		||||
      newsList({
 | 
			
		||||
        association_id: store.state.Gid,
 | 
			
		||||
        type: this.type,
 | 
			
		||||
        gory_id: this.gory_id,
 | 
			
		||||
        page: this.page,
 | 
			
		||||
        size: this.size
 | 
			
		||||
      })
 | 
			
		||||
          .then(res => {
 | 
			
		||||
            console.log(res);
 | 
			
		||||
            if (res.code == 1) {
 | 
			
		||||
              this.news_list.push(...res.data.ret);
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
          .catch(error => {
 | 
			
		||||
            uni.showToast({
 | 
			
		||||
              title: error,
 | 
			
		||||
              icon: 'none',
 | 
			
		||||
              duration: 2000
 | 
			
		||||
            });
 | 
			
		||||
          })
 | 
			
		||||
    },
 | 
			
		||||
    cardSwiper(d) {
 | 
			
		||||
      this.cardCur = d.detail.current;
 | 
			
		||||
    },
 | 
			
		||||
    ReachBottom() {
 | 
			
		||||
      console.log('home');
 | 
			
		||||
      this.page = this.page + 1;
 | 
			
		||||
      this.getNewsList();
 | 
			
		||||
      //this.getIndex();
 | 
			
		||||
    },
 | 
			
		||||
    change(e) {
 | 
			
		||||
      this.current = e;
 | 
			
		||||
      var info = this.goryList[e];
 | 
			
		||||
      this.gory_id = info.id;
 | 
			
		||||
      this.type = e === 0 ? 1 : 0;
 | 
			
		||||
      this.page = 1;
 | 
			
		||||
      this.news_list = [];
 | 
			
		||||
      this.getNewsList();
 | 
			
		||||
    },
 | 
			
		||||
    openUrl(url) {
 | 
			
		||||
      uni.navigateTo({
 | 
			
		||||
        url: url
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    opentab() {
 | 
			
		||||
      uni.$emit('depId', {
 | 
			
		||||
        index: 1
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
    videoErrorCallback: function (e) {
 | 
			
		||||
      uni.showModal({
 | 
			
		||||
        content: e.target.errMsg,
 | 
			
		||||
        showCancel: false
 | 
			
		||||
      })
 | 
			
		||||
    },
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -1,154 +1,227 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <view class="template-edit tn-safe-area-inset-bottom">
 | 
			
		||||
    <!-- 顶部自定义导航 -->
 | 
			
		||||
    <tn-nav-bar :isBack="false" backTitle="" :bottomShadow="true" backgroundColor="#FFFFFF">
 | 
			
		||||
      <view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left">
 | 
			
		||||
        <view style="padding-left: 15rpx;" @click="goBack()">
 | 
			
		||||
          <text class="tn-icon-left" style="font-size: 40rpx;"></text>
 | 
			
		||||
        </view>
 | 
			
		||||
        <view class="tn-margin-top"
 | 
			
		||||
              style=";text-shadow:  1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;">
 | 
			
		||||
          <tn-tabs :list="[{name:'邀请入会'}]" :current="topCurrent" activeColor="#000" :bold="false"
 | 
			
		||||
                   :fontSize="36"></tn-tabs>
 | 
			
		||||
        </view>
 | 
			
		||||
      </view>
 | 
			
		||||
    </tn-nav-bar>
 | 
			
		||||
	<view class="template-edit tn-safe-area-inset-bottom">
 | 
			
		||||
		<!-- 顶部自定义导航 -->
 | 
			
		||||
		<tn-nav-bar :isBack="false" backTitle="" :bottomShadow="true" backgroundColor="#FFFFFF">
 | 
			
		||||
			<view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left">
 | 
			
		||||
				<view style="padding-left: 15rpx;" @click="goBack()">
 | 
			
		||||
					<text class="tn-icon-left" style="font-size: 40rpx;"></text>
 | 
			
		||||
				</view>
 | 
			
		||||
				<view class="tn-margin-top"
 | 
			
		||||
					style=";text-shadow:  1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;">
 | 
			
		||||
					<tn-tabs :list="[{name:'邀请入会'}]" :current="topCurrent" activeColor="#000" :bold="false"
 | 
			
		||||
						:fontSize="36"></tn-tabs>
 | 
			
		||||
				</view>
 | 
			
		||||
			</view>
 | 
			
		||||
		</tn-nav-bar>
 | 
			
		||||
 | 
			
		||||
    <view class="tn-safe-area-inset-bottom" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
 | 
			
		||||
      <view style="padding: 50rpx">
 | 
			
		||||
        <view>
 | 
			
		||||
          <tn-button backgroundColor="#82B2FF" height="80rpx" :shadow="true" fontColor="#ffffff" width="100%">生成二维码</tn-button>
 | 
			
		||||
        </view>
 | 
			
		||||
        <view style="margin-top: 40rpx">
 | 
			
		||||
          <tn-button open-type="share" backgroundColor="#82B2FF" height="80rpx" :shadow="true" fontColor="#ffffff" width="100%">转发到微信好友</tn-button>
 | 
			
		||||
        </view>
 | 
			
		||||
      </view>
 | 
			
		||||
      <view style="padding:20rpx 40rpx">
 | 
			
		||||
        <view style="font-size: 32rpx">我邀请的会员</view>
 | 
			
		||||
        <view>
 | 
			
		||||
          <view class="tn-flex tn-flex-center tn-flex-col-center" style="padding: 30rpx;width: 100%;">
 | 
			
		||||
            <view>
 | 
			
		||||
              <image src="/static/def.png" style="width: 100rpx;height: 100rpx;border-radius: 50%;"></image>
 | 
			
		||||
            </view>
 | 
			
		||||
            <view style="width: 100%;">
 | 
			
		||||
              <view class="tn-flex tn-flex-col-center tn-flex-row-between">
 | 
			
		||||
                <view style="margin-left: 20rpx;color: #000000">
 | 
			
		||||
                  <view style="font-size: 35rpx;">王小明</view>
 | 
			
		||||
                </view>
 | 
			
		||||
              </view>
 | 
			
		||||
            </view>
 | 
			
		||||
          </view>
 | 
			
		||||
        </view>
 | 
			
		||||
      </view>
 | 
			
		||||
    </view>
 | 
			
		||||
    <view class='tn-tabbar-height'></view>
 | 
			
		||||
  </view>
 | 
			
		||||
		<view class="tn-safe-area-inset-bottom" :style="{paddingTop: vuex_custom_bar_height + 'px'}">
 | 
			
		||||
			<view style="padding: 50rpx">
 | 
			
		||||
				<view>
 | 
			
		||||
					<tn-button @click="openQrcode" backgroundColor="#82B2FF" height="80rpx" :shadow="true"
 | 
			
		||||
						fontColor="#ffffff" width="100%">生成二维码</tn-button>
 | 
			
		||||
				</view>
 | 
			
		||||
				<view style="margin-top: 40rpx">
 | 
			
		||||
					<tn-button open-type="share" backgroundColor="#82B2FF" height="80rpx" :shadow="true"
 | 
			
		||||
						fontColor="#ffffff" width="100%">转发到微信好友</tn-button>
 | 
			
		||||
				</view>
 | 
			
		||||
			</view>
 | 
			
		||||
<!--			<view style="padding:20rpx 40rpx">-->
 | 
			
		||||
<!--				<view style="font-size: 32rpx">我邀请的会员:30位</view>-->
 | 
			
		||||
<!--				<view>-->
 | 
			
		||||
<!--					<view class="tn-flex tn-flex-center tn-flex-col-center" style="padding: 30rpx;width: 100%;">-->
 | 
			
		||||
<!--						<view>-->
 | 
			
		||||
<!--							<image src="/static/def.png" style="width: 100rpx;height: 100rpx;border-radius: 50%;">-->
 | 
			
		||||
<!--							</image>-->
 | 
			
		||||
<!--						</view>-->
 | 
			
		||||
<!--						<view style="width: 100%;">-->
 | 
			
		||||
<!--							<view class="tn-flex tn-flex-col-center tn-flex-row-between">-->
 | 
			
		||||
<!--								<view style="margin-left: 20rpx;color: #000000">-->
 | 
			
		||||
<!--									<view style="font-size: 35rpx;">王小明</view>-->
 | 
			
		||||
<!--								</view>-->
 | 
			
		||||
<!--							</view>-->
 | 
			
		||||
<!--						</view>-->
 | 
			
		||||
<!--					</view>-->
 | 
			
		||||
<!--				</view>-->
 | 
			
		||||
<!--			</view>-->
 | 
			
		||||
		</view>
 | 
			
		||||
		<tn-popup :closeBtn="true" v-model="show" mode="center" width="500rpx" height="700rpx">
 | 
			
		||||
			<div style="text-align: center;padding: 30rpx;font-size: 32rpx;font-weight: 600;">使用二维码邀请入会</div>
 | 
			
		||||
			<view style="text-align: center;margin-top: 40rpx;">
 | 
			
		||||
				<image :src="qrcode_url" style="width: 400rpx;height: 400rpx;"></image>
 | 
			
		||||
			</view>
 | 
			
		||||
			<view style="text-align: center;margin-top: 40rpx;">
 | 
			
		||||
				<tn-button shape="round" backgroundColor="#82B2FF" fontColor="#ffffff"
 | 
			
		||||
					@click="saveBase64">保存图片</tn-button>
 | 
			
		||||
			</view>
 | 
			
		||||
		</tn-popup>
 | 
			
		||||
		<view class='tn-tabbar-height'></view>
 | 
			
		||||
	</view>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
import {
 | 
			
		||||
  getUserIndex,
 | 
			
		||||
} from "@/util/api";
 | 
			
		||||
import store from "@/store";
 | 
			
		||||
export default {
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      topCurrent: 0,
 | 
			
		||||
      uid:0,
 | 
			
		||||
      userInfo:{},
 | 
			
		||||
      apiImgUrl: this.$store.state.imgUrl,
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  onShareAppMessage() {
 | 
			
		||||
    return {
 | 
			
		||||
      title: this.userInfo.nikename+'邀请你加入【'+this.userInfo.association_name+'】',
 | 
			
		||||
      path: '/pages/index/apply_in?id='+this.uid+"&association_id="+this.userInfo.association_id,
 | 
			
		||||
      imageUrl: this.apiImgUrl+this.userInfo.association_image,
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  onShareTimeline() { // 分享到朋友圈
 | 
			
		||||
    return {
 | 
			
		||||
      title: this.userInfo.nikename+'邀请你加入【'+this.userInfo.association_name+'】',
 | 
			
		||||
      path: '/pages/index/apply_in?id='+this.uid+"&association_id="+this.userInfo.association_id,
 | 
			
		||||
      imageUrl: this.apiImgUrl+this.userInfo.association_image,
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  onLoad() {
 | 
			
		||||
    var u = uni.getStorageSync('uid');
 | 
			
		||||
    this.uid = u;
 | 
			
		||||
    this.getUserInfo();
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    getUserInfo() {
 | 
			
		||||
      getUserIndex({
 | 
			
		||||
        member_b_id: this.uid,
 | 
			
		||||
        member_id: this.uid
 | 
			
		||||
      })
 | 
			
		||||
          .then(res => {
 | 
			
		||||
            console.log(res);
 | 
			
		||||
            if (res.code == 1) {
 | 
			
		||||
              this.userInfo = res.data;
 | 
			
		||||
            }
 | 
			
		||||
          })
 | 
			
		||||
          .catch(error => {
 | 
			
		||||
            uni.showToast({
 | 
			
		||||
              title: error,
 | 
			
		||||
              icon: 'none',
 | 
			
		||||
              duration: 2000
 | 
			
		||||
            });
 | 
			
		||||
          })
 | 
			
		||||
    },
 | 
			
		||||
    // 跳转
 | 
			
		||||
    tn(e) {
 | 
			
		||||
      uni.navigateTo({
 | 
			
		||||
        url: e,
 | 
			
		||||
      });
 | 
			
		||||
    },
 | 
			
		||||
    goBack() {
 | 
			
		||||
      if (getCurrentPages().length > 1) {
 | 
			
		||||
        uni.navigateBack()
 | 
			
		||||
      } else {
 | 
			
		||||
        uni.redirectTo({
 | 
			
		||||
          url: '/pages/index/index'
 | 
			
		||||
        })
 | 
			
		||||
	import {
 | 
			
		||||
		getUserIndex,
 | 
			
		||||
		getQrcode
 | 
			
		||||
	} from "@/util/api";
 | 
			
		||||
	import store from "@/store";
 | 
			
		||||
	export default {
 | 
			
		||||
		data() {
 | 
			
		||||
			return {
 | 
			
		||||
				show: false,
 | 
			
		||||
				topCurrent: 0,
 | 
			
		||||
				uid: 0,
 | 
			
		||||
				userInfo: {},
 | 
			
		||||
				apiImgUrl: this.$store.state.imgUrl,
 | 
			
		||||
				qrcode_url: ''
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		onShareAppMessage() {
 | 
			
		||||
			return {
 | 
			
		||||
				title: this.userInfo.nikename + '邀请你加入【' + this.userInfo.association_name + '】',
 | 
			
		||||
				path: '/pages/index/apply_in?id=' + this.uid + "&association_id=" + this.userInfo.association_id,
 | 
			
		||||
				imageUrl: this.apiImgUrl + this.userInfo.association_image,
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		onShareTimeline() { // 分享到朋友圈
 | 
			
		||||
			return {
 | 
			
		||||
				title: this.userInfo.nikename + '邀请你加入【' + this.userInfo.association_name + '】',
 | 
			
		||||
				path: '/pages/index/apply_in?id=' + this.uid + "&association_id=" + this.userInfo.association_id,
 | 
			
		||||
				imageUrl: this.apiImgUrl + this.userInfo.association_image,
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		onLoad() {
 | 
			
		||||
			var u = uni.getStorageSync('uid');
 | 
			
		||||
			this.uid = u;
 | 
			
		||||
			this.getUserInfo();
 | 
			
		||||
		},
 | 
			
		||||
		methods: {
 | 
			
		||||
			saveBase64() {
 | 
			
		||||
				wx.saveImageToPhotosAlbum({
 | 
			
		||||
					filePath: this.qrcode_url,
 | 
			
		||||
					success: function(res) {
 | 
			
		||||
						wx.showToast({
 | 
			
		||||
							title: '保存成功',
 | 
			
		||||
						})
 | 
			
		||||
					},
 | 
			
		||||
					fail: function(err) {
 | 
			
		||||
						console.log(err, '失败')
 | 
			
		||||
					}
 | 
			
		||||
				})
 | 
			
		||||
			},
 | 
			
		||||
			openQrcode() {
 | 
			
		||||
        uni.showLoading({
 | 
			
		||||
					title: '生成中',
 | 
			
		||||
          mask:true,
 | 
			
		||||
				});
 | 
			
		||||
				var that = this;
 | 
			
		||||
				uni.request({
 | 
			
		||||
					url: store.state.apiUrl + '/move/login/getUnlimitedQRCode',
 | 
			
		||||
					method: 'POST',
 | 
			
		||||
					data: {
 | 
			
		||||
						path: 'pages/index/apply_in',
 | 
			
		||||
						scene: "id=" + this.uid + "&association_id=" + this.userInfo.association_id
 | 
			
		||||
					},
 | 
			
		||||
					responseType: 'arraybuffer',
 | 
			
		||||
					arraybuffer: true,
 | 
			
		||||
					success: (result) => {
 | 
			
		||||
						const url = 'data:image/png;base64,' + uni.arrayBufferToBase64(result.data);
 | 
			
		||||
						that.base64ToImage(url);
 | 
			
		||||
					}
 | 
			
		||||
				})
 | 
			
		||||
			},
 | 
			
		||||
			base64ToImage(base64Data) {
 | 
			
		||||
				var that = this;
 | 
			
		||||
				const fs = uni.getFileSystemManager();
 | 
			
		||||
				var filePath = wx.env.USER_DATA_PATH + '/qrcode.jpg';
 | 
			
		||||
				const base64 = base64Data.split(',')[1]; // 获取base64字符串部分
 | 
			
		||||
				fs.writeFile({
 | 
			
		||||
					filePath: filePath,
 | 
			
		||||
					data: base64,
 | 
			
		||||
					encoding: 'base64',
 | 
			
		||||
					success: (res) => {
 | 
			
		||||
						that.qrcode_url = filePath;
 | 
			
		||||
						console.log('图片保存成功', filePath);
 | 
			
		||||
						// 成功回调
 | 
			
		||||
						that.show = true;
 | 
			
		||||
            uni.hideLoading()
 | 
			
		||||
					},
 | 
			
		||||
					fail: (err) => {
 | 
			
		||||
						console.error('图片保存失败', err);
 | 
			
		||||
            uni.hideLoading()
 | 
			
		||||
						// 失败回调
 | 
			
		||||
					}
 | 
			
		||||
				});
 | 
			
		||||
			},
 | 
			
		||||
			getUserInfo() {
 | 
			
		||||
				getUserIndex({
 | 
			
		||||
						member_b_id: this.uid,
 | 
			
		||||
						member_id: this.uid
 | 
			
		||||
					})
 | 
			
		||||
					.then(res => {
 | 
			
		||||
						console.log(res);
 | 
			
		||||
						if (res.code == 1) {
 | 
			
		||||
							this.userInfo = res.data;
 | 
			
		||||
						}
 | 
			
		||||
					})
 | 
			
		||||
					.catch(error => {
 | 
			
		||||
						uni.showToast({
 | 
			
		||||
							title: error,
 | 
			
		||||
							icon: 'none',
 | 
			
		||||
							duration: 2000
 | 
			
		||||
						});
 | 
			
		||||
					})
 | 
			
		||||
			},
 | 
			
		||||
			// 跳转
 | 
			
		||||
			tn(e) {
 | 
			
		||||
				uni.navigateTo({
 | 
			
		||||
					url: e,
 | 
			
		||||
				});
 | 
			
		||||
			},
 | 
			
		||||
			goBack() {
 | 
			
		||||
				if (getCurrentPages().length > 1) {
 | 
			
		||||
					uni.navigateBack()
 | 
			
		||||
				} else {
 | 
			
		||||
					uni.redirectTo({
 | 
			
		||||
						url: '/pages/index/index'
 | 
			
		||||
					})
 | 
			
		||||
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
				}
 | 
			
		||||
			},
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style lang="scss" scoped>
 | 
			
		||||
/* 底部悬浮按钮 start*/
 | 
			
		||||
.tn-tabbar-height {
 | 
			
		||||
  min-height: 100rpx;
 | 
			
		||||
  height: calc(120rpx + env(safe-area-inset-bottom) / 2);
 | 
			
		||||
}
 | 
			
		||||
	/* 底部悬浮按钮 start*/
 | 
			
		||||
	.tn-tabbar-height {
 | 
			
		||||
		min-height: 100rpx;
 | 
			
		||||
		height: calc(120rpx + env(safe-area-inset-bottom) / 2);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
.tn-footerfixed {
 | 
			
		||||
  position: fixed;
 | 
			
		||||
  width: 100%;
 | 
			
		||||
  bottom: calc(30rpx + env(safe-area-inset-bottom));
 | 
			
		||||
  z-index: 1024;
 | 
			
		||||
  box-shadow: 0 1rpx 6rpx rgba(0, 0, 0, 0);
 | 
			
		||||
	.tn-footerfixed {
 | 
			
		||||
		position: fixed;
 | 
			
		||||
		width: 100%;
 | 
			
		||||
		bottom: calc(30rpx + env(safe-area-inset-bottom));
 | 
			
		||||
		z-index: 1024;
 | 
			
		||||
		box-shadow: 0 1rpx 6rpx rgba(0, 0, 0, 0);
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
/* 底部悬浮按钮 end*/
 | 
			
		||||
	/* 底部悬浮按钮 end*/
 | 
			
		||||
 | 
			
		||||
/* 标签内容 start*/
 | 
			
		||||
.tn-tag-content {
 | 
			
		||||
  &__item {
 | 
			
		||||
    display: inline-block;
 | 
			
		||||
    line-height: 45rpx;
 | 
			
		||||
    padding: 10rpx 30rpx;
 | 
			
		||||
    margin: 20rpx 20rpx 5rpx 0rpx;
 | 
			
		||||
	/* 标签内容 start*/
 | 
			
		||||
	.tn-tag-content {
 | 
			
		||||
		&__item {
 | 
			
		||||
			display: inline-block;
 | 
			
		||||
			line-height: 45rpx;
 | 
			
		||||
			padding: 10rpx 30rpx;
 | 
			
		||||
			margin: 20rpx 20rpx 5rpx 0rpx;
 | 
			
		||||
 | 
			
		||||
    &--prefix {
 | 
			
		||||
      padding-right: 10rpx;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
			&--prefix {
 | 
			
		||||
				padding-right: 10rpx;
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
/* 标签内容 end*/
 | 
			
		||||
	/* 标签内容 end*/
 | 
			
		||||
</style>
 | 
			
		||||
 | 
			
		||||
@ -37,7 +37,7 @@
 | 
			
		||||
			</view>
 | 
			
		||||
		</view>
 | 
			
		||||
		<view>
 | 
			
		||||
			<block>
 | 
			
		||||
			<!-- <block>
 | 
			
		||||
				<view>
 | 
			
		||||
					<view class="tn-flex tn-flex-row-between tn-margin">
 | 
			
		||||
						<view class="justify-content-item tn-text-bold">
 | 
			
		||||
@ -57,14 +57,14 @@
 | 
			
		||||
						</view>
 | 
			
		||||
					</view>
 | 
			
		||||
				</view>
 | 
			
		||||
			</block>
 | 
			
		||||
			<view class="tn-flex tn-flex-row-between tn-padding-bottom"
 | 
			
		||||
			</block> -->
 | 
			
		||||
			<!-- <view class="tn-flex tn-flex-row-between tn-padding-bottom"
 | 
			
		||||
				style="padding-top: 20rpx;margin: 30rpx 30rpx 0rpx 30rpx;">
 | 
			
		||||
				<view class="justify-content-item tn-text-bold">
 | 
			
		||||
					<text class="tn-text-df tn-color-black">会员搜索结果</text>
 | 
			
		||||
				</view>
 | 
			
		||||
			</view>
 | 
			
		||||
			<view style="padding:0rpx 30rpx;">
 | 
			
		||||
			</view> -->
 | 
			
		||||
			<!-- <view style="padding:0rpx 30rpx;">
 | 
			
		||||
				<view class="tn-flex tn-flex-center tn-flex-col-center" @click="tn('/pages/index/user_info')"
 | 
			
		||||
					style="background-color: #ffffff;padding:30rpx;border-radius: 15rpx;margin-bottom: 20rpx;box-shadow: 0rpx 0rpx 10rpx 0rpx rgba(12,0,5,0.1);">
 | 
			
		||||
					<view>
 | 
			
		||||
@ -118,7 +118,7 @@
 | 
			
		||||
						<image src="/static/c1.jpg" style="width: 240rpx;border-radius: 10rpx;" mode="widthFix"></image>
 | 
			
		||||
					</view>
 | 
			
		||||
				</view>
 | 
			
		||||
			</view>
 | 
			
		||||
			</view> -->
 | 
			
		||||
		</view>
 | 
			
		||||
	</view>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
@ -78,10 +78,11 @@
 | 
			
		||||
					<!--							<view style="margin-left: 20rpx;">所在商/协会</view>-->
 | 
			
		||||
					<!--						</view>-->
 | 
			
		||||
					<!--					</tn-list-cell>-->
 | 
			
		||||
					<tn-list-cell :arrow="true" @click="tn('/pages/index/my_apply')">
 | 
			
		||||
					<tn-list-cell :arrow="true"
 | 
			
		||||
						@click="tn('/pages/index/apply_in?association_id='+loginData.association_id)">
 | 
			
		||||
						<view class="tn-flex tn-flex-center tn-flex-col-center">
 | 
			
		||||
							<image src="/static/ico8.png" style="width: 50rpx;height: 50rpx"></image>
 | 
			
		||||
							<view style="margin-left: 20rpx;">入会申请记录</view>
 | 
			
		||||
							<view style="margin-left: 20rpx;">入会申请</view>
 | 
			
		||||
						</view>
 | 
			
		||||
					</tn-list-cell>
 | 
			
		||||
					<tn-list-cell :arrow="true" @click="tn('/pages/index/my_msg')">
 | 
			
		||||
@ -120,28 +121,38 @@
 | 
			
		||||
				</view>
 | 
			
		||||
			</view>
 | 
			
		||||
		</view>
 | 
			
		||||
		<tn-modal v-model="loginMod" :custom="true">
 | 
			
		||||
		<tn-popup v-model="loginMod" mode="bottom" height="50%">
 | 
			
		||||
			<view class="custom-modal-content">
 | 
			
		||||
				<view style="text-align: center;font-size: 34rpx;">会员登陆</view>
 | 
			
		||||
				<view class="text">
 | 
			
		||||
				<view style="font-size: 30rpx;padding: 30rpx 30rpx 0rpx 30rpx;font-weight: 600;letter-spacing: 2rpx">
 | 
			
		||||
					会员登陆</view>
 | 
			
		||||
				<view class="text" style="padding: 40rpx;">
 | 
			
		||||
					<tn-form ref="form" :labelWidth="120">
 | 
			
		||||
						<tn-form-item label="手机号" prop="phone">
 | 
			
		||||
							<tn-input v-model="loginData.phone" />
 | 
			
		||||
						<tn-form-item prop="phone">
 | 
			
		||||
							<tn-input placeholder="手机号" :customStyle="{width: '660rpx'}" v-model="loginData.phone" />
 | 
			
		||||
						</tn-form-item>
 | 
			
		||||
						<tn-form-item label="密码" prop="password">
 | 
			
		||||
							<tn-input v-model="loginData.password" type="password" />
 | 
			
		||||
						<view style="height: 20rpx;"></view>
 | 
			
		||||
						<tn-form-item prop="password">
 | 
			
		||||
							<tn-input placeholder="密码" :customStyle="{width: '660rpx'}" :passwordIcon="false" v-model="loginData.password"
 | 
			
		||||
								type="password" />
 | 
			
		||||
						</tn-form-item>
 | 
			
		||||
						<tn-form-item prop="code">
 | 
			
		||||
							<tn-input v-model="code" :customStyle="{width: '400rpx'}" type="text" placeholder="请输入验证码"></tn-input>
 | 
			
		||||
 | 
			
		||||
							<view slot="right">
 | 
			
		||||
								<jp-verification-literalness ref='capture' :contentHeight="40"
 | 
			
		||||
									:contentWidth="100"></jp-verification-literalness>
 | 
			
		||||
							</view>
 | 
			
		||||
						</tn-form-item>
 | 
			
		||||
					</tn-form>
 | 
			
		||||
					<view style="text-align: center;margin-top: 30rpx;">
 | 
			
		||||
						<tn-button backgroundColor="#E6E6E6" fontColor="#ffffff"
 | 
			
		||||
							@click="loginMod = false">取消</tn-button>
 | 
			
		||||
						<tn-button backgroundColor="tn-bg-blue" fontColor="tn-color-white" style="margin-left: 30rpx"
 | 
			
		||||
							@click="submitLogin">确定
 | 
			
		||||
						</tn-button>
 | 
			
		||||
					<view style="text-align: center;margin-top: 50rpx;">
 | 
			
		||||
						<!-- <tn-button backgroundColor="#E6E6E6" fontColor="#ffffff"
 | 
			
		||||
							@click="loginMod = false">取消</tn-button> -->
 | 
			
		||||
						<tn-button style="border-radius: 0px;" height="80rpx" backgroundColor="#EEF0F2" width="100%"
 | 
			
		||||
							fontColor="#000000" @click="submitLogin">确定</tn-button>
 | 
			
		||||
					</view>
 | 
			
		||||
				</view>
 | 
			
		||||
			</view>
 | 
			
		||||
		</tn-modal>
 | 
			
		||||
		</tn-popup>
 | 
			
		||||
	</view>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
@ -166,6 +177,7 @@
 | 
			
		||||
					password: '',
 | 
			
		||||
					association_id: store.state.Gid
 | 
			
		||||
				},
 | 
			
		||||
				code: '',
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		mounted() {
 | 
			
		||||
@ -198,6 +210,15 @@
 | 
			
		||||
					})
 | 
			
		||||
			},
 | 
			
		||||
			submitLogin() {
 | 
			
		||||
				var key = this.$refs.capture.verification(this.code);
 | 
			
		||||
        if(!key){
 | 
			
		||||
          uni.showToast({
 | 
			
		||||
            title: '验证码错误!',
 | 
			
		||||
            icon: 'none',
 | 
			
		||||
            duration: 2000
 | 
			
		||||
          });
 | 
			
		||||
          return;
 | 
			
		||||
        }
 | 
			
		||||
				this.loginData.openid = uni.getStorageSync('openid');
 | 
			
		||||
				loginDo(this.loginData)
 | 
			
		||||
					.then(res => {
 | 
			
		||||
@ -256,5 +277,10 @@
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style>
 | 
			
		||||
 | 
			
		||||
.my_input view{
 | 
			
		||||
  width: 100% !important;
 | 
			
		||||
}
 | 
			
		||||
.my_input input{
 | 
			
		||||
  width: 100% !important;
 | 
			
		||||
}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								static/48098160.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 2.0 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								static/48098162.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 2.0 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								static/48098163.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 781 B  | 
							
								
								
									
										
											BIN
										
									
								
								static/48098164.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 894 B  | 
							
								
								
									
										
											BIN
										
									
								
								static/48098165.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 4.6 KiB  | 
| 
		 Before Width: | Height: | Size: 191 KiB  | 
| 
		 Before Width: | Height: | Size: 213 KiB  | 
| 
		 Before Width: | Height: | Size: 57 KiB  | 
@ -131,8 +131,9 @@
 | 
			
		||||
 | 
			
		||||
.spot.active {
 | 
			
		||||
	opacity: 1;
 | 
			
		||||
	width: 30rpx;
 | 
			
		||||
	background-color: #FFFFFF;
 | 
			
		||||
	width: 10rpx;
 | 
			
		||||
	height: 10rpx;
 | 
			
		||||
	background-color: rgb(217, 217, 217);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										4
									
								
								uni_modules/jp-verification-literalness/changelog.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						@ -0,0 +1,4 @@
 | 
			
		||||
## 1.1.0(2023-12-11)
 | 
			
		||||
修复微信小程序报错问题
 | 
			
		||||
## 1.0.0(2023-08-21)
 | 
			
		||||
上线
 | 
			
		||||
@ -0,0 +1,170 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <div :style="{height: (contentHeight+'px'),width: (contentWidth+'px')}">
 | 
			
		||||
    <canvas
 | 
			
		||||
	  v-if="canvasId"
 | 
			
		||||
      @tap="drawTap"
 | 
			
		||||
      :id="canvasId"
 | 
			
		||||
	  :canvasId="canvasId"
 | 
			
		||||
      :width="contentWidth"
 | 
			
		||||
      :height="contentHeight"
 | 
			
		||||
	  :style="{height: (contentHeight+'px'),width: (contentWidth+'px')}"
 | 
			
		||||
    ></canvas>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
<!-- jp-verification-literalness  -->
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
  name: "jp-verification-literalness",
 | 
			
		||||
  props: {
 | 
			
		||||
	securityCode:{
 | 
			
		||||
		type: String,
 | 
			
		||||
		default: '',
 | 
			
		||||
	},
 | 
			
		||||
	codeLength: { //验证码数量
 | 
			
		||||
      type: Number,
 | 
			
		||||
      default: 4,
 | 
			
		||||
    },
 | 
			
		||||
    contentWidth: {
 | 
			
		||||
      type: Number,
 | 
			
		||||
      default: 120,
 | 
			
		||||
    },
 | 
			
		||||
    contentHeight: {
 | 
			
		||||
      type: Number,
 | 
			
		||||
      default: 60,
 | 
			
		||||
    },
 | 
			
		||||
	lineLength: { //线条数
 | 
			
		||||
      type: Number,
 | 
			
		||||
      default: 8,
 | 
			
		||||
    },
 | 
			
		||||
	backgroundColor:{ // 画板背景
 | 
			
		||||
		type: String,
 | 
			
		||||
		default: 'rgb(238,226,224)',
 | 
			
		||||
	},
 | 
			
		||||
	lineColorList:{
 | 
			
		||||
		type: Array,
 | 
			
		||||
		default () {
 | 
			
		||||
			return ['rgba(238,0,0,.5)','rgba(0, 170, 255,.5)','rgba(0, 170, 0,.5)','rgba(0, 0, 0,.5)','rgba(153, 146, 255,.5)']
 | 
			
		||||
		},
 | 
			
		||||
	},
 | 
			
		||||
	colorList:{
 | 
			
		||||
		type: Array,
 | 
			
		||||
		default () {
 | 
			
		||||
			return ['rgb(238,0,0)','rgb(0, 170, 255)','rgb(0, 170, 0)','rgb(0, 0, 0)','rgb(153, 146, 255)']
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
  },
 | 
			
		||||
  computed:{
 | 
			
		||||
	 canvasId() {
 | 
			
		||||
	 	// #ifdef VUE2
 | 
			
		||||
	 	return `lime-signature${this._uid}`
 | 
			
		||||
	 	// #endif
 | 
			
		||||
	 	// #ifdef VUE3
 | 
			
		||||
	 	return `lime-signature${this._.uid}`
 | 
			
		||||
	 	// #endif
 | 
			
		||||
	 },
 | 
			
		||||
  },
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
      identifyCode: '',
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  watch:{
 | 
			
		||||
	securityCode() {
 | 
			
		||||
		this.drawPic();
 | 
			
		||||
	}
 | 
			
		||||
  },
 | 
			
		||||
  methods: {
 | 
			
		||||
    verification(code) {
 | 
			
		||||
      return this.identifyCode.toLowerCase() === code.toLowerCase();
 | 
			
		||||
    },
 | 
			
		||||
    randomNum(min, max) {
 | 
			
		||||
      return Math.floor(Math.random() * (max - min) + min);
 | 
			
		||||
    },
 | 
			
		||||
    getcheckCode() {
 | 
			
		||||
      let code = '';
 | 
			
		||||
      const codeLength = this.codeLength
 | 
			
		||||
      const random = [
 | 
			
		||||
        1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
 | 
			
		||||
        'J', 'K', 'L', 'M', 'N', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W',
 | 
			
		||||
        'X', 'Y', 'Z',
 | 
			
		||||
      ];
 | 
			
		||||
      for (let i = 0; i < codeLength; i++) {
 | 
			
		||||
        let index = Math.floor(Math.random() * 34);
 | 
			
		||||
        code += random[index];
 | 
			
		||||
      }
 | 
			
		||||
      this.identifyCode = code;
 | 
			
		||||
    },
 | 
			
		||||
	drawTap(){
 | 
			
		||||
		if(this.securityCode){
 | 
			
		||||
			this.$emit('getCode')
 | 
			
		||||
		}else{
 | 
			
		||||
			this.drawPic();
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
    drawPic() {
 | 
			
		||||
		if(this.securityCode){
 | 
			
		||||
			this.identifyCode = this.securityCode
 | 
			
		||||
		}else{
 | 
			
		||||
			this.getcheckCode();
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
      let context = uni.createCanvasContext(this.canvasId, this);
 | 
			
		||||
 | 
			
		||||
      context.setTextBaseline('bottom');
 | 
			
		||||
 | 
			
		||||
      context.setFillStyle(this.backgroundColor);
 | 
			
		||||
 | 
			
		||||
      context.fillRect(0, 0, this.contentWidth, this.contentHeight);
 | 
			
		||||
      for (let i = 0; i < this.identifyCode.length; i++) {
 | 
			
		||||
        this.drawText(context, this.identifyCode[i], i);
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      this.drawLine(context);
 | 
			
		||||
 | 
			
		||||
      context.draw();
 | 
			
		||||
    },
 | 
			
		||||
    drawText(context, txt, i) {
 | 
			
		||||
 | 
			
		||||
	  let a =  Math.floor(Math.random()*this.colorList.length)
 | 
			
		||||
      context.setFillStyle(this.colorList[a]);
 | 
			
		||||
 | 
			
		||||
	  let fontSize = Math.trunc((this.contentWidth/this.identifyCode.length))
 | 
			
		||||
	  console.log(fontSize)
 | 
			
		||||
      context.setFontSize(
 | 
			
		||||
        this.randomNum(fontSize, fontSize) + 'px SimHei'
 | 
			
		||||
      );
 | 
			
		||||
 | 
			
		||||
      let x = (i) * (this.contentWidth / (this.identifyCode.length + 1)) + Math.trunc(fontSize/2);
 | 
			
		||||
      let y = this.randomNum(fontSize, this.contentHeight - 5);
 | 
			
		||||
      var deg = this.randomNum(-10, 10);
 | 
			
		||||
 | 
			
		||||
      context.translate(x, y);
 | 
			
		||||
      context.rotate((deg * Math.PI) / 180);
 | 
			
		||||
      context.fillText(txt, 0, 0);
 | 
			
		||||
 | 
			
		||||
      context.rotate((-deg * Math.PI) / 180);
 | 
			
		||||
      context.translate(-x, -y);
 | 
			
		||||
    },
 | 
			
		||||
    drawLine(context) {
 | 
			
		||||
       for (let i = 0; i < this.lineLength; i++) {
 | 
			
		||||
		  let a = Math.floor(Math.random() * this.lineColorList.length)
 | 
			
		||||
          context.setStrokeStyle(this.lineColorList[a]);
 | 
			
		||||
          context.beginPath();
 | 
			
		||||
          let startX = this.randomNum(0, this.contentWidth);
 | 
			
		||||
          let startY = this.randomNum(0, this.contentHeight);
 | 
			
		||||
          let endX = this.randomNum(0, this.contentWidth);
 | 
			
		||||
          let endY = this.randomNum(0, this.contentHeight);
 | 
			
		||||
          context.moveTo(startX, startY);
 | 
			
		||||
          context.lineTo(endX, endY);
 | 
			
		||||
          context.stroke();
 | 
			
		||||
        }
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  mounted() {
 | 
			
		||||
    this.drawPic();
 | 
			
		||||
  },
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped>
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										85
									
								
								uni_modules/jp-verification-literalness/package.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						@ -0,0 +1,85 @@
 | 
			
		||||
{
 | 
			
		||||
  "id": "jp-verification-literalness",
 | 
			
		||||
  "displayName": "验证码 canvas绘制验证码图片 登录验证 图形验证码组件",
 | 
			
		||||
  "version": "1.1.0",
 | 
			
		||||
  "description": "用于验证,可以由前端自动生成验证码,或通过接口获取验证码,用法简单",
 | 
			
		||||
  "keywords": [
 | 
			
		||||
    "验证码",
 | 
			
		||||
    "文字验证码",
 | 
			
		||||
    "登录验证",
 | 
			
		||||
    "图形验证码组件",
 | 
			
		||||
    "接口/前端生成验证码"
 | 
			
		||||
],
 | 
			
		||||
  "repository": "",
 | 
			
		||||
  "engines": {
 | 
			
		||||
    "HBuilderX": "^3.1.0"
 | 
			
		||||
  },
 | 
			
		||||
  "dcloudext": {
 | 
			
		||||
    "type": "component-vue",
 | 
			
		||||
    "sale": {
 | 
			
		||||
      "regular": {
 | 
			
		||||
        "price": "0.00"
 | 
			
		||||
      },
 | 
			
		||||
      "sourcecode": {
 | 
			
		||||
        "price": "0.00"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "contact": {
 | 
			
		||||
      "qq": ""
 | 
			
		||||
    },
 | 
			
		||||
    "declaration": {
 | 
			
		||||
      "ads": "无",
 | 
			
		||||
      "data": "无",
 | 
			
		||||
      "permissions": "无"
 | 
			
		||||
    },
 | 
			
		||||
    "npmurl": ""
 | 
			
		||||
  },
 | 
			
		||||
  "uni_modules": {
 | 
			
		||||
    "dependencies": [],
 | 
			
		||||
    "encrypt": [],
 | 
			
		||||
    "platforms": {
 | 
			
		||||
      "cloud": {
 | 
			
		||||
        "tcb": "y",
 | 
			
		||||
        "aliyun": "y"
 | 
			
		||||
      },
 | 
			
		||||
      "client": {
 | 
			
		||||
        "Vue": {
 | 
			
		||||
          "vue2": "y",
 | 
			
		||||
          "vue3": "y"
 | 
			
		||||
        },
 | 
			
		||||
        "App": {
 | 
			
		||||
          "app-vue": "y",
 | 
			
		||||
          "app-nvue": "y"
 | 
			
		||||
        },
 | 
			
		||||
        "H5-mobile": {
 | 
			
		||||
          "Safari": "y",
 | 
			
		||||
          "Android Browser": "y",
 | 
			
		||||
          "微信浏览器(Android)": "y",
 | 
			
		||||
          "QQ浏览器(Android)": "y"
 | 
			
		||||
        },
 | 
			
		||||
        "H5-pc": {
 | 
			
		||||
          "Chrome": "y",
 | 
			
		||||
          "IE": "y",
 | 
			
		||||
          "Edge": "y",
 | 
			
		||||
          "Firefox": "y",
 | 
			
		||||
          "Safari": "y"
 | 
			
		||||
        },
 | 
			
		||||
        "小程序": {
 | 
			
		||||
          "微信": "y",
 | 
			
		||||
          "阿里": "y",
 | 
			
		||||
          "百度": "y",
 | 
			
		||||
          "字节跳动": "y",
 | 
			
		||||
          "QQ": "y",
 | 
			
		||||
          "钉钉": "y",
 | 
			
		||||
          "快手": "y",
 | 
			
		||||
          "飞书": "y",
 | 
			
		||||
          "京东": "y"
 | 
			
		||||
        },
 | 
			
		||||
        "快应用": {
 | 
			
		||||
          "华为": "y",
 | 
			
		||||
          "联盟": "y"
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,38 @@
 | 
			
		||||
<template>
 | 
			
		||||
  <view class="content">
 | 
			
		||||
	<view class="hader">基础用法</view>
 | 
			
		||||
	<jp-verification-literalness></jp-verification-literalness>
 | 
			
		||||
	<view class="hader">通过接口获取验证码</view>
 | 
			
		||||
	<jp-verification-literalness @getCode="getCode" :securityCode="securityCode"></jp-verification-literalness>
 | 
			
		||||
	<view class="hader"> 自定义验证码数量 - 自定义颜色</view>
 | 
			
		||||
	<jp-verification-literalness backgroundColor="#a7c3ff"  :colorList="colorList" :lineColorList="lineColorList"  :codeLength="6" ></jp-verification-literalness> 
 | 
			
		||||
    <view class="hader"> 验证码大小 - 干扰线数量</view>
 | 
			
		||||
    <jp-verification-literalness :contentHeight="100" :contentWidth="200" :lineLength="60"></jp-verification-literalness>
 | 
			
		||||
  </view>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
		val:'',
 | 
			
		||||
		securityCode:'我是获取的',
 | 
			
		||||
		lineColorList: ['rgba(0, 85, 255, 0.5)','rgba(85, 255, 0, 0.5)','rgba(255, 255, 0, 0.5)'],
 | 
			
		||||
		colorList:['rgb(255, 0, 0)','rgb(255, 0, 127)','rgb(255, 0, 255)']
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  methods:{
 | 
			
		||||
	  getCode(){
 | 
			
		||||
		this.securityCode = '重新获取了'  
 | 
			
		||||
	  }
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style scoped lang="scss">
 | 
			
		||||
	.content {
 | 
			
		||||
		padding: 0 20px;
 | 
			
		||||
		.hader {
 | 
			
		||||
			line-height: 80rpx;
 | 
			
		||||
			font-weight: 800;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										79
									
								
								uni_modules/jp-verification-literalness/readme.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						@ -0,0 +1,79 @@
 | 
			
		||||
# 
 | 
			
		||||
#  # 欢迎使用 layout jp-verification-literalness組件
 | 
			
		||||
**jp-verification-literalness組件,是验证码组件。
 | 
			
		||||
用于登录验证,获取其他需要验证的地方,可以起前端自动生成验证码,或通过接口调用验证码,自定义验证框颜色。用法简单
 | 
			
		||||
 | 
			
		||||
### 安装方式
 | 
			
		||||
本组件符合[easycom](https://uniapp.dcloud.io/collocation/pages?id=easycom)规范,`HBuilderX 2.5.5`起,只需将本组件导入项目,在页面`template`中即可直接使用,无需在页面中`import`和注册`components`。
 | 
			
		||||
 | 
			
		||||
##有项目需要开发的请联系 QQ:371524845
 | 
			
		||||
###开发不易,如果帮助到你的,请支持 有问题请留言,作者会积极更新
 | 
			
		||||
 | 
			
		||||
###项目实例请查看 @/jp-layout/pages/index/index.vue
 | 
			
		||||
 | 
			
		||||
#使用方法
 | 
			
		||||
##### layout基础用法
 | 
			
		||||
```html
 | 
			
		||||
<template>
 | 
			
		||||
  <view class="content">
 | 
			
		||||
	<view class="hader">基础用法</view>
 | 
			
		||||
	<jp-verification-literalness></jp-verification-literalness>
 | 
			
		||||
	<view class="hader">通过接口获取验证码</view>
 | 
			
		||||
	<jp-verification-literalness @getCode="getCode" :securityCode="securityCode"></jp-verification-literalness>
 | 
			
		||||
	<view class="hader"> 自定义验证码数量 - 自定义颜色</view>
 | 
			
		||||
	<jp-verification-literalness backgroundColor="#a7c3ff"  :colorList="colorList" :lineColorList="lineColorList"  :codeLength="6" ></jp-verification-literalness> 
 | 
			
		||||
    <view class="hader"> 验证码大小 - 干扰线数量</view>
 | 
			
		||||
    <jp-verification-literalness :contentHeight="100" :contentWidth="200" :lineLength="60"></jp-verification-literalness>
 | 
			
		||||
  </view>
 | 
			
		||||
</template>
 | 
			
		||||
<script>
 | 
			
		||||
export default {
 | 
			
		||||
  data() {
 | 
			
		||||
    return {
 | 
			
		||||
		val:'',
 | 
			
		||||
		securityCode:'我是获取的',
 | 
			
		||||
		lineColorList: ['rgba(0, 85, 255, 0.5)','rgba(85, 255, 0, 0.5)','rgba(255, 255, 0, 0.5)'],
 | 
			
		||||
		colorList:['rgb(255, 0, 0)','rgb(255, 0, 127)','rgb(255, 0, 255)']
 | 
			
		||||
    };
 | 
			
		||||
  },
 | 
			
		||||
  methods:{
 | 
			
		||||
	  getCode(){
 | 
			
		||||
		this.securityCode = '重新获取了'  
 | 
			
		||||
	  }
 | 
			
		||||
  }
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
<style scoped lang="scss">
 | 
			
		||||
	.content {
 | 
			
		||||
		padding: 0 20px;
 | 
			
		||||
		.hader {
 | 
			
		||||
			line-height: 80rpx;
 | 
			
		||||
			font-weight: 800;
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
</style>
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
###方法介绍 
 | 
			
		||||
####参数
 | 
			
		||||
| 参数名        | 类型   |  默认值  | 说明  |
 | 
			
		||||
| --------   |  -------- |  --------| --------|
 | 
			
		||||
|   securityCode   |  securityCode  |   ''    |  验证码值,如果是通过接口调用的验证码需要在这里传入,不传入则自动生成验证码     |
 | 
			
		||||
|   codeLength   | Number  |   4    |  自动生成验证码数量 |
 | 
			
		||||
|   contentWidth   | Number  |   120    |   画板宽度(px)    |
 | 
			
		||||
| contentHeight        |   Number   |  60   |  画板高度(px)       |
 | 
			
		||||
| lineLength        |    Number    |  8 | 干扰线数量 |
 | 
			
		||||
| backgroundColor        |    String    |  'rgb(238,226,224)' |  触底加载触发距离 |
 | 
			
		||||
| lineColorList        |  Array     |  ['rgba(238,0,0,.5)','rgba(0, 170, 255,.5)','rgba(0, 170, 0,.5)','rgba(0, 0, 0,.5)','rgba(153, 146, 255,.5)']  | 干扰线可选颜色组(颜色会随机选择这些颜色,需要固定颜色传一种颜色即可)  |
 | 
			
		||||
| colorList        |    Array    |  ['rgb(238,0,0)','rgb(0, 170, 255)','rgb(0, 170, 0)','rgb(0, 0, 0)','rgb(153, 146, 255)'] |  文字可选颜色组(颜色会随机选择这些颜色,需要固定颜色传一种颜色即可) |
 | 
			
		||||
 | 
			
		||||
####方法
 | 
			
		||||
| 方法名        |   返回值 | 说明  |
 | 
			
		||||
| --------   |  --------|--------|
 | 
			
		||||
|  verification  | function()   | 验证验证码是否正确,正确返回true   | 
 | 
			
		||||
 | 
			
		||||
####事件
 | 
			
		||||
| 方法名        |   返回值 | 说明  |
 | 
			
		||||
| --------   |  --------|--------|
 | 
			
		||||
|   @getCode  | function()   |当传入securityCode时点击会回调该方法,用户可以在这里通过接口获取验证码   | 
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										223
									
								
								uni_modules/lime-painter/changelog.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						@ -0,0 +1,223 @@
 | 
			
		||||
## 1.9.6.5(2024-04-14)
 | 
			
		||||
- fix: 修复`nvue`无法生图的问题
 | 
			
		||||
## 1.9.6.4(2024-03-10)
 | 
			
		||||
- fix: 修复代理ctx导致H5不能使用ctx.save
 | 
			
		||||
## 1.9.6.3(2024-03-08)
 | 
			
		||||
- fix: 修复支付宝真机无法使用的问题
 | 
			
		||||
## 1.9.6.2(2024-02-22)
 | 
			
		||||
- fix: 修复使用render函数报错的问题
 | 
			
		||||
## 1.9.6.1(2023-12-22)
 | 
			
		||||
- fix: 修复字节小程序非2d字体偏移
 | 
			
		||||
- fix: 修复`canvasToTempFilePathSync`会触发两次的问题
 | 
			
		||||
- fix: 修复`parser`图片没有宽度的问题
 | 
			
		||||
## 1.9.6(2023-12-06)
 | 
			
		||||
- fix: 修复背景图受padding影响
 | 
			
		||||
- fix: 修复因字节报错改了代理实现导致微信报错
 | 
			
		||||
- 1.9.5.8(2023-11-16)
 | 
			
		||||
- fix: 修复margin问题
 | 
			
		||||
- fix: 修复borderWidth问题
 | 
			
		||||
- fix: 修复textBox问题
 | 
			
		||||
- fix: 修复字节开发工具报`could not be cloned.`问题
 | 
			
		||||
## 1.9.5.7(2023-07-27)
 | 
			
		||||
- fix: 去掉多余的方法
 | 
			
		||||
- chore: 更新文档,增加自定义字体说明
 | 
			
		||||
## 1.9.5.6(2023-07-21)
 | 
			
		||||
- feat: 有限的支持富文本
 | 
			
		||||
- feat: H5和APP 增加 `hidpi` prop,主要用于大尺寸无法生成图片时用
 | 
			
		||||
- fix: 修复 钉钉小程序 缺少 `measureText` 方法
 | 
			
		||||
- chore: 由于微信小程序 pc 端的 canvas 2d 时不时抽风,故不使用canvas 2d
 | 
			
		||||
## 1.9.5.5(2023-06-27)
 | 
			
		||||
- fix: 修复把`emoji`表情字符拆分成多个字符的情况
 | 
			
		||||
## 1.9.5.4(2023-06-05)
 | 
			
		||||
- fix: 修复因`canvasToTempFilePathSync`监听导致重复调用
 | 
			
		||||
## 1.9.5.3(2023-05-23)
 | 
			
		||||
- fix: 因isPc错写成了isPC导致小程序PC不能生成图片
 | 
			
		||||
## 1.9.5.2(2023-05-22)
 | 
			
		||||
- feat: 删除多余文件
 | 
			
		||||
## 1.9.5.1(2023-05-22)
 | 
			
		||||
- fix: 修复 文字行数与`line-clamp`相同但不满一行时也加了省略号的问题
 | 
			
		||||
## 1.9.5(2023-05-14)
 | 
			
		||||
- feat: 增加 `text-indent` 和 `calc` 方法
 | 
			
		||||
- feat: 优化 布局时间
 | 
			
		||||
## 1.9.4.4(2023-04-15)
 | 
			
		||||
- fix: 修复无法匹配负值
 | 
			
		||||
- fix: 修复 Nvue IOS getImageInfo `useCORS` 为 undefined
 | 
			
		||||
## 1.9.4.3(2023-04-01)
 | 
			
		||||
- feat: 增加支持文字描边 `text-stroke: '5rpx #fff'`
 | 
			
		||||
## 1.9.4.2(2023-03-30)
 | 
			
		||||
- fix: 修复 支付宝小程序 isPC 在手机也为true的问题
 | 
			
		||||
- feat: 由 微信开发工具 3060 版 无法获取图片尺寸,现 微信开发工具 3220 版 修复该问题,故还原上一版的获取图片方式。
 | 
			
		||||
## 1.9.4.1(2023-03-28)
 | 
			
		||||
- fix: 修复固定高度不正确问题
 | 
			
		||||
## 1.9.4(2023-03-17)
 | 
			
		||||
- fix: nvue ios getImageInfo缺少this报错
 | 
			
		||||
- fix: pathType 非2d无效问题
 | 
			
		||||
- fix: 修复 小米9se 可能会存在多次init 导致画面多次放大
 | 
			
		||||
- fix: 修复 border 分开写 width style无效问题
 | 
			
		||||
- fix: 修复 支付宝小程序IOS 再次进入不渲染的问题
 | 
			
		||||
- fix: 修复 支付宝小程序安卓Zindex排序错乱问题
 | 
			
		||||
- fix: 修复 微信开发工具 3060 版 无法获取图片的问题
 | 
			
		||||
- feat: 把 for in 改为 forEach
 | 
			
		||||
- feat: 增加 hidden
 | 
			
		||||
- feat: 根节点 box-sizing 默认 `border-box`
 | 
			
		||||
- feat: 增加支持 `vw` `wh`
 | 
			
		||||
- chore: pathType 取消 默认值,因为字节开发工具不能显示
 | 
			
		||||
- chore: 支付宝小程序开发工具不支持 生成图片 请以真机调试为准
 | 
			
		||||
- bug: 企业微信 2.20.3无法使用
 | 
			
		||||
## 1.9.3.5(2022-06-29)
 | 
			
		||||
- feat: justifyContent 增加 `space-around`、`space-between`
 | 
			
		||||
- feat: canvas 2d 也使用`getImageInfo`
 | 
			
		||||
- fix: 修复 `text`的 `text-decoration`错位
 | 
			
		||||
## 1.9.3.4(2022-06-20)
 | 
			
		||||
- fix: 修复 因创建节点速度问题导致顺序出错。 
 | 
			
		||||
- fix: 修复 微信小程序 PC 无法显示本地图片 
 | 
			
		||||
- fix: 修复 flex-box 对齐问题 
 | 
			
		||||
- feat: 增加 `text-shadow`
 | 
			
		||||
- feat: 重写 `text` 对齐方式
 | 
			
		||||
- chore: 更新文档
 | 
			
		||||
## 1.9.3.3(2022-06-17)
 | 
			
		||||
- fix: 修复 支付宝小程序 canvas 2d 存在ctx.draw问题导致报错
 | 
			
		||||
- fix: 修复 支付宝小程序 toDataURL 存在权限问题改用 `toTempFilePath`
 | 
			
		||||
- fix: 修复 支付宝小程序 image size 问题导致 `objectFit` 无效
 | 
			
		||||
## 1.9.3.2(2022-06-14)
 | 
			
		||||
- fix: 修复 image 设置背景色不生效问题
 | 
			
		||||
- fix: 修复 nvue 环境判断缺少参数问题
 | 
			
		||||
## 1.9.3.1(2022-06-14)
 | 
			
		||||
- fix: 修复 bottom 定位不对问题
 | 
			
		||||
- fix: 修复 因小数导致计算出错换行问题
 | 
			
		||||
- feat: 增加 `useCORS` h5端图片跨域 在设置请求头无效果后试一下设置这个值
 | 
			
		||||
- chore: 更新文档
 | 
			
		||||
## 1.9.3(2022-06-13)
 | 
			
		||||
- feat: 增加 `zIndex`
 | 
			
		||||
- feat: 增加 `flex-box` 该功能处于原始阶段,非常简陋。
 | 
			
		||||
- tips: QQ小程序 vue3 不支持, 为 uni 官方BUG
 | 
			
		||||
## 1.9.2.9(2022-06-10)
 | 
			
		||||
- fix: 修复`text-align`及`margin`居中问题
 | 
			
		||||
## 1.9.2.8(2022-06-10)
 | 
			
		||||
- fix: 修复 Nvue `canvasToTempFilePathSync` 不生效问题
 | 
			
		||||
## 1.9.2.7(2022-06-10)
 | 
			
		||||
- fix: 修复 margin及padding的bug
 | 
			
		||||
- fix: 修复 Nvue `isCanvasToTempFilePath` 不生效问题
 | 
			
		||||
## 1.9.2.6(2022-06-09)
 | 
			
		||||
- fix: 修复 Nvue 不显示
 | 
			
		||||
- feat: 增加支持字体渐变
 | 
			
		||||
```html
 | 
			
		||||
<l-painter-text 
 | 
			
		||||
	text="水调歌头\n明月几时有?把酒问青天。不知天上宫阙,今夕是何年。我欲乘风归去,又恐琼楼玉宇,高处不胜寒。起舞弄清影,何似在人间。"
 | 
			
		||||
	css="background: linear-gradient(,#ff971b 0%, #1989fa 100%); background-clip: text" />
 | 
			
		||||
```
 | 
			
		||||
## 1.9.2.5(2022-06-09)
 | 
			
		||||
- chore: 更变获取父级宽度的设定
 | 
			
		||||
- chore: `pathType` 在canvas 2d 默认为 `url`
 | 
			
		||||
## 1.9.2.4(2022-06-08)
 | 
			
		||||
- fix: 修复 `pathType` 不生效问题
 | 
			
		||||
## 1.9.2.3(2022-06-08)
 | 
			
		||||
- fix: 修复 `canvasToTempFilePath` 漏写 `success` 参数
 | 
			
		||||
## 1.9.2.2(2022-06-07)
 | 
			
		||||
- chore: 更新文档
 | 
			
		||||
## 1.9.2.1(2022-06-07)
 | 
			
		||||
- fix: 修复 vue3 赋值给this再传入导致image无法绘制
 | 
			
		||||
- fix: 修复 `canvasToTempFilePathSync` 时机问题
 | 
			
		||||
- feat: canvas 2d 更改图片生成方式 `toDataURL` 
 | 
			
		||||
## 1.9.2(2022-05-30)
 | 
			
		||||
- fix: 修复 `canvasToTempFilePathSync` 在 vue3 下只生成一次
 | 
			
		||||
## 1.9.1.7(2022-05-28)
 | 
			
		||||
- fix: 修复 `qrcode`显示不全问题
 | 
			
		||||
## 1.9.1.6(2022-05-28)
 | 
			
		||||
- fix: 修复 `canvasToTempFilePathSync` 会重复多次问题
 | 
			
		||||
- fix: 修复 `view` css `backgroundImage` 图片下载失败导致 子节点不渲染
 | 
			
		||||
## 1.9.1.5(2022-05-27)
 | 
			
		||||
- fix: 修正支付宝小程序 canvas 2d版本号 2.7.15
 | 
			
		||||
## 1.9.1.4(2022-05-22)
 | 
			
		||||
- fix: 修复字节小程序无法使用xml方式
 | 
			
		||||
- fix: 修复字节小程序无法使用base64(非2D情况下工具上无法显示)
 | 
			
		||||
- fix: 修复支付宝小程序 `canvasToTempFilePath` 报错
 | 
			
		||||
## 1.9.1.3(2022-04-29)
 | 
			
		||||
- fix: 修复vue3打包后uni对象为空后的报错
 | 
			
		||||
## 1.9.1.2(2022-04-25)
 | 
			
		||||
- fix: 删除多余文件
 | 
			
		||||
## 1.9.1.1(2022-04-25)
 | 
			
		||||
- fix: 修复图片不显示问题
 | 
			
		||||
## 1.9.1(2022-04-12)
 | 
			
		||||
- fix: 因四舍五入导致有些机型错位
 | 
			
		||||
- fix: 修复无views报错 
 | 
			
		||||
- chore: nvue下因ios无法读取插件内static文件,改由下载方式
 | 
			
		||||
## 1.9.0(2022-03-20)
 | 
			
		||||
- fix: 因无法固定尺寸导致生成图片不全
 | 
			
		||||
- fix: 特定情况下text判断无效
 | 
			
		||||
- chore: 本地化APP Nvue webview
 | 
			
		||||
## 1.8.9(2022-02-20)
 | 
			
		||||
- fix: 修复 小程序下载最多10次并发的问题
 | 
			
		||||
- fix: 修复 APP端无法获取本地图片
 | 
			
		||||
- fix: 修复 APP Nvue端不执行问题
 | 
			
		||||
- chore: 增加图片缓存机制
 | 
			
		||||
## 1.8.8.8(2022-01-27)
 | 
			
		||||
- fix: 修复 主动调用尺寸问题
 | 
			
		||||
## 1.8.8.6(2022-01-26)
 | 
			
		||||
- fix: 修复 nvue 下无宽度时获取父级宽度 
 | 
			
		||||
- fix: 修复 ios app 无法渲染问题
 | 
			
		||||
## 1.8.8(2022-01-23)
 | 
			
		||||
- fix: 修复 主动调用时无节点问题
 | 
			
		||||
- fix: 修复 `box-shadow` 颜色问题
 | 
			
		||||
- fix: 修复 `transform:rotate` 角度位置问题
 | 
			
		||||
- feat: 增加 `overflow:hidden`
 | 
			
		||||
## 1.8.7(2022-01-07)
 | 
			
		||||
- fix: 修复 image 方向为 `right` 时原始宽高问题
 | 
			
		||||
- feat: 支持 view 设置背景图 `background-image: url(xxx)`
 | 
			
		||||
- chore: 去掉可选链
 | 
			
		||||
## 1.8.6(2021-11-28)
 | 
			
		||||
- feat: 支持`view`对`inline-block`的子集使用`text-align`
 | 
			
		||||
## 1.8.5.5(2021-08-17)
 | 
			
		||||
- chore: 更新文档,删除 replace
 | 
			
		||||
- fix: 修复 text 值为 number时报错
 | 
			
		||||
## 1.8.5.4(2021-08-16)
 | 
			
		||||
- fix: 字节小程序兼容
 | 
			
		||||
## 1.8.5.3(2021-08-15)
 | 
			
		||||
- fix: 修复线性渐变与css现实效果不一致的问题
 | 
			
		||||
- chore: 更新文档
 | 
			
		||||
## 1.8.5.2(2021-08-13)
 | 
			
		||||
- chore: 增加`background-image`、`background-repeat` 能力,主要用于背景纹理的绘制,并不是代替`image`。例如:大面积的重复平铺的水印
 | 
			
		||||
- 注意:这个功能H5暂时无法使用,因为[官方的API有BUG](https://ask.dcloud.net.cn/question/128793),待官方修复!!!
 | 
			
		||||
## 1.8.5.1(2021-08-10)
 | 
			
		||||
- fix: 修复因`margin`报错问题
 | 
			
		||||
## 1.8.5(2021-08-09)
 | 
			
		||||
- chore: 增加margin支持`auto`,以达到居中效果
 | 
			
		||||
## 1.8.4(2021-08-06)
 | 
			
		||||
- chore: 增加判断缓存文件条件
 | 
			
		||||
- fix: 修复css 多余空格报错问题
 | 
			
		||||
## 1.8.3(2021-08-04)
 | 
			
		||||
- tips: 1.6.x 以下的版本升级到1.8.x后要为每个元素都加上定位:position: 'absolute'
 | 
			
		||||
- fix: 修复只有一个view子元素时不计算高度的问题
 | 
			
		||||
## 1.8.2(2021-08-03)
 | 
			
		||||
- fix: 修复 path-type 为 `url` 无效问题
 | 
			
		||||
- fix: 修复 qrcode `text` 为空时报错问题
 | 
			
		||||
- fix: 修复 image `src` 动态设置时不生效问题
 | 
			
		||||
- feat: 增加 css 属性 `min-width` `max-width`
 | 
			
		||||
## 1.8.1(2021-08-02)
 | 
			
		||||
- fix: 修复无法加载本地图片
 | 
			
		||||
## 1.8.0(2021-08-02)
 | 
			
		||||
- chore 文档更新
 | 
			
		||||
- 使用旧版的同学不要升级!
 | 
			
		||||
## 1.8.0-beta(2021-07-30)
 | 
			
		||||
- ## 全新布局方式 不兼容旧版!
 | 
			
		||||
- chore: 布局方式变更
 | 
			
		||||
- tips: 微信canvas 2d 不支持真机调试
 | 
			
		||||
## 1.6.6(2021-07-09)
 | 
			
		||||
- chore: 统一命名规范,无须主动引入组件
 | 
			
		||||
## 1.6.5(2021-06-08)
 | 
			
		||||
- chore: 去掉console
 | 
			
		||||
## 1.6.4(2021-06-07)
 | 
			
		||||
- fix: 修复 数字 为纯字符串时不转换的BUG
 | 
			
		||||
## 1.6.3(2021-06-06)
 | 
			
		||||
- fix: 修复 PC 端放大的BUG
 | 
			
		||||
## 1.6.2(2021-05-31)
 | 
			
		||||
- fix: 修复 报`adaptor is not a function`错误
 | 
			
		||||
- fix: 修复 text 多行高度
 | 
			
		||||
- fix: 优化 默认文字的基准线
 | 
			
		||||
- feat: `@progress`事件,监听绘制进度
 | 
			
		||||
## 1.6.1(2021-02-28)
 | 
			
		||||
- 删除多余节点
 | 
			
		||||
## 1.6.0(2021-02-26)
 | 
			
		||||
- 调整为uni_modules目录规范
 | 
			
		||||
- 修复:transform的rotate不能为负数问题
 | 
			
		||||
- 新增:`pathType` 指定生成图片返回的路径类型,可选值有 `base64`、`url`
 | 
			
		||||
							
								
								
									
										150
									
								
								uni_modules/lime-painter/components/common/relation.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						@ -0,0 +1,150 @@
 | 
			
		||||
const styles = (v ='') =>  v.split(';').filter(v => v && !/^[\n\s]+$/.test(v)).map(v => {
 | 
			
		||||
						const key = v.slice(0, v.indexOf(':'))
 | 
			
		||||
						const value = v.slice(v.indexOf(':')+1)
 | 
			
		||||
						return {
 | 
			
		||||
							[key
 | 
			
		||||
								.replace(/-([a-z])/g, function() { return arguments[1].toUpperCase()})
 | 
			
		||||
								.replace(/\s+/g, '')
 | 
			
		||||
							]: value.replace(/^\s+/, '').replace(/\s+$/, '') || ''
 | 
			
		||||
						}
 | 
			
		||||
					})
 | 
			
		||||
export function parent(parent) {
 | 
			
		||||
	return {
 | 
			
		||||
		provide() {
 | 
			
		||||
			return {
 | 
			
		||||
				[parent]: this
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		data() {
 | 
			
		||||
			return {
 | 
			
		||||
				el: {
 | 
			
		||||
					id: null,
 | 
			
		||||
					css: {},
 | 
			
		||||
					views: []
 | 
			
		||||
				},
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		watch: {
 | 
			
		||||
			css: { 
 | 
			
		||||
				handler(v) {
 | 
			
		||||
					if(this.canvasId) {
 | 
			
		||||
						this.el.css = (typeof v == 'object' ? v : v && Object.assign(...styles(v))) || {}
 | 
			
		||||
						this.canvasWidth = this.el.css && this.el.css.width || this.canvasWidth
 | 
			
		||||
						this.canvasHeight = this.el.css && this.el.css.height || this.canvasHeight
 | 
			
		||||
					}
 | 
			
		||||
				},
 | 
			
		||||
				immediate: true
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
export function children(parent, options = {}) {
 | 
			
		||||
	const indexKey = options.indexKey || 'index'
 | 
			
		||||
	return {
 | 
			
		||||
		inject: {
 | 
			
		||||
			[parent]: {
 | 
			
		||||
				default: null
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		watch: {
 | 
			
		||||
			el: {
 | 
			
		||||
				handler(v, o) {
 | 
			
		||||
					if(JSON.stringify(v) != JSON.stringify(o))
 | 
			
		||||
						this.bindRelation()
 | 
			
		||||
				},
 | 
			
		||||
				deep: true,
 | 
			
		||||
				immediate: true
 | 
			
		||||
			},
 | 
			
		||||
			src: {
 | 
			
		||||
				handler(v, o) {
 | 
			
		||||
					if(v != o)
 | 
			
		||||
						this.bindRelation()
 | 
			
		||||
				},
 | 
			
		||||
				immediate: true
 | 
			
		||||
			},
 | 
			
		||||
			text: {
 | 
			
		||||
				handler(v, o) {
 | 
			
		||||
					if(v != o) this.bindRelation()
 | 
			
		||||
				},
 | 
			
		||||
				immediate: true
 | 
			
		||||
			},
 | 
			
		||||
			css: {
 | 
			
		||||
				handler(v, o) {
 | 
			
		||||
					if(v != o)
 | 
			
		||||
						this.el.css = (typeof v == 'object' ? v : v && Object.assign(...styles(v))) || {}
 | 
			
		||||
				},
 | 
			
		||||
				immediate: true
 | 
			
		||||
			},
 | 
			
		||||
			replace: {
 | 
			
		||||
				handler(v, o) {
 | 
			
		||||
					if(JSON.stringify(v) != JSON.stringify(o))
 | 
			
		||||
						this.bindRelation()
 | 
			
		||||
				},
 | 
			
		||||
				deep: true,
 | 
			
		||||
				immediate: true
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		created() {
 | 
			
		||||
			if(!this._uid) {
 | 
			
		||||
				this._uid = this._.uid
 | 
			
		||||
			}
 | 
			
		||||
			Object.defineProperty(this, 'parent', {
 | 
			
		||||
				get: () => this[parent] || [],
 | 
			
		||||
			})
 | 
			
		||||
			Object.defineProperty(this, 'index', {
 | 
			
		||||
				get: () =>  {
 | 
			
		||||
					this.bindRelation();
 | 
			
		||||
					const {parent: {el: {views=[]}={}}={}} = this
 | 
			
		||||
					return views.indexOf(this.el)
 | 
			
		||||
				},
 | 
			
		||||
			});
 | 
			
		||||
			this.el.type = this.type
 | 
			
		||||
			if(this.uid) {
 | 
			
		||||
				this.el.uid = this.uid
 | 
			
		||||
			}
 | 
			
		||||
			this.bindRelation()
 | 
			
		||||
		},
 | 
			
		||||
		// #ifdef VUE3
 | 
			
		||||
		beforeUnmount() {
 | 
			
		||||
			this.removeEl()
 | 
			
		||||
		},
 | 
			
		||||
		// #endif
 | 
			
		||||
		// #ifdef VUE2
 | 
			
		||||
		beforeDestroy() {
 | 
			
		||||
			this.removeEl()
 | 
			
		||||
		},
 | 
			
		||||
		// #endif
 | 
			
		||||
		methods: {
 | 
			
		||||
			removeEl() {
 | 
			
		||||
				if (this.parent) {
 | 
			
		||||
					this.parent.el.views = this.parent.el.views.filter(
 | 
			
		||||
						(item) => item._uid !== this._uid
 | 
			
		||||
					);
 | 
			
		||||
				}
 | 
			
		||||
			},
 | 
			
		||||
			bindRelation() {
 | 
			
		||||
				if(!this.el._uid) {
 | 
			
		||||
					this.el._uid = this._uid 
 | 
			
		||||
				}
 | 
			
		||||
				if(['text','qrcode'].includes(this.type)) {
 | 
			
		||||
					this.el.text = this.$slots && this.$slots.default && this.$slots.default[0].text || `${this.text || ''}`.replace(/\\n/g, '\n')
 | 
			
		||||
				}
 | 
			
		||||
				if(this.type == 'image') {
 | 
			
		||||
					this.el.src = this.src
 | 
			
		||||
				}
 | 
			
		||||
				if (!this.parent) {
 | 
			
		||||
					return;
 | 
			
		||||
				}
 | 
			
		||||
				let views = this.parent.el.views || [];
 | 
			
		||||
				if(views.indexOf(this.el) !== -1) {
 | 
			
		||||
					this.parent.el.views = views.map(v => v._uid == this._uid ? this.el : v)
 | 
			
		||||
				} else {
 | 
			
		||||
					this.parent.el.views = [...views, this.el];
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		mounted() {
 | 
			
		||||
			// this.bindRelation()
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@ -0,0 +1,28 @@
 | 
			
		||||
<template>
 | 
			
		||||
	
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
	import {parent, children} from '../common/relation';
 | 
			
		||||
	export default {
 | 
			
		||||
		name: 'lime-painter-image',
 | 
			
		||||
		mixins:[children('painter')],
 | 
			
		||||
		props: {
 | 
			
		||||
			id: String,
 | 
			
		||||
			css: [String, Object],
 | 
			
		||||
			src: String
 | 
			
		||||
		},
 | 
			
		||||
		data() {
 | 
			
		||||
			return {
 | 
			
		||||
				type: 'image',
 | 
			
		||||
				el: {
 | 
			
		||||
					css: {},
 | 
			
		||||
					src: null
 | 
			
		||||
				},
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style>
 | 
			
		||||
</style>
 | 
			
		||||
@ -0,0 +1,27 @@
 | 
			
		||||
<template>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
	import {parent, children} from '../common/relation';
 | 
			
		||||
	export default {
 | 
			
		||||
		name: 'lime-painter-qrcode',
 | 
			
		||||
		mixins:[children('painter')],
 | 
			
		||||
		props: {
 | 
			
		||||
			id: String,
 | 
			
		||||
			css: [String, Object],
 | 
			
		||||
			text: String
 | 
			
		||||
		},
 | 
			
		||||
		data() {
 | 
			
		||||
			return {
 | 
			
		||||
				type: 'qrcode',
 | 
			
		||||
				el: {
 | 
			
		||||
					css: {},
 | 
			
		||||
					text: null
 | 
			
		||||
				},
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style>
 | 
			
		||||
</style>
 | 
			
		||||
@ -0,0 +1,33 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<text style="opacity: 0;height: 0;"><slot/></text>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
	import {parent, children} from '../common/relation';
 | 
			
		||||
	export default {
 | 
			
		||||
		name: 'lime-painter-text',
 | 
			
		||||
		mixins:[children('painter')],
 | 
			
		||||
		props: {
 | 
			
		||||
			type: {
 | 
			
		||||
				type: String,
 | 
			
		||||
				default: 'text'
 | 
			
		||||
			},
 | 
			
		||||
			uid: String,
 | 
			
		||||
			css: [String, Object],
 | 
			
		||||
			text: [String, Number],
 | 
			
		||||
			replace: Object,
 | 
			
		||||
		},
 | 
			
		||||
		data() {
 | 
			
		||||
			return {
 | 
			
		||||
				// type: 'text',
 | 
			
		||||
				el: {
 | 
			
		||||
					css: {},
 | 
			
		||||
					text: null
 | 
			
		||||
				},
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style>
 | 
			
		||||
</style>
 | 
			
		||||
@ -0,0 +1,34 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<view><slot/></view>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
	import {parent, children} from '../common/relation';
 | 
			
		||||
	export default {
 | 
			
		||||
		name: 'lime-painter-view',
 | 
			
		||||
		mixins:[children('painter'), parent('painter')],
 | 
			
		||||
		props: {
 | 
			
		||||
			id: String,
 | 
			
		||||
			type: {
 | 
			
		||||
				type: String,
 | 
			
		||||
				default: 'view'
 | 
			
		||||
			},
 | 
			
		||||
			css: [String, Object],
 | 
			
		||||
		},
 | 
			
		||||
		data() {
 | 
			
		||||
			return {
 | 
			
		||||
				// type: 'view',
 | 
			
		||||
				el: {
 | 
			
		||||
					css: {},
 | 
			
		||||
					views:[]
 | 
			
		||||
				},
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		mounted() {
 | 
			
		||||
			
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style>
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										461
									
								
								uni_modules/lime-painter/components/l-painter/l-painter.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						@ -0,0 +1,461 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<view class="lime-painter" ref="limepainter">
 | 
			
		||||
		<view v-if="canvasId && size" :style="styles">
 | 
			
		||||
			<!-- #ifndef APP-NVUE -->
 | 
			
		||||
			<canvas class="lime-painter__canvas" v-if="use2dCanvas" :id="canvasId" type="2d" :style="size"></canvas>
 | 
			
		||||
			<canvas class="lime-painter__canvas" v-else :id="canvasId" :canvas-id="canvasId" :style="size"
 | 
			
		||||
				:width="boardWidth * dpr" :height="boardHeight * dpr" :hidpi="hidpi"></canvas>
 | 
			
		||||
 | 
			
		||||
			<!-- #endif -->
 | 
			
		||||
			<!-- #ifdef APP-NVUE -->
 | 
			
		||||
			<web-view :style="size" ref="webview"
 | 
			
		||||
				src="/uni_modules/lime-painter/hybrid/html/index.html"
 | 
			
		||||
				class="lime-painter__canvas" @pagefinish="onPageFinish" @error="onError" @onPostMessage="onMessage">
 | 
			
		||||
			</web-view>
 | 
			
		||||
			<!-- #endif -->
 | 
			
		||||
		</view>
 | 
			
		||||
		<slot />
 | 
			
		||||
	</view>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script>
 | 
			
		||||
	import { parent } from '../common/relation'
 | 
			
		||||
	import props from './props'
 | 
			
		||||
	import {toPx, base64ToPath, pathToBase64, isBase64, sleep, getImageInfo }from './utils';
 | 
			
		||||
	//  #ifndef APP-NVUE
 | 
			
		||||
	import { canIUseCanvas2d, isPC} from './utils';
 | 
			
		||||
	import Painter from './painter';
 | 
			
		||||
	// import Painter from '@painter'
 | 
			
		||||
	const nvue = {}
 | 
			
		||||
	//  #endif
 | 
			
		||||
	//  #ifdef APP-NVUE
 | 
			
		||||
	import nvue from './nvue'
 | 
			
		||||
	//  #endif
 | 
			
		||||
	export default {
 | 
			
		||||
		name: 'lime-painter',
 | 
			
		||||
		mixins: [props, parent('painter'), nvue],
 | 
			
		||||
		data() {
 | 
			
		||||
			return {
 | 
			
		||||
				use2dCanvas: false,
 | 
			
		||||
				canvasHeight: 150,
 | 
			
		||||
				canvasWidth: null,
 | 
			
		||||
				parentWidth: 0,
 | 
			
		||||
				inited: false,
 | 
			
		||||
				progress: 0,
 | 
			
		||||
				firstRender: 0,
 | 
			
		||||
				done: false,
 | 
			
		||||
				tasks: []
 | 
			
		||||
			};
 | 
			
		||||
		},
 | 
			
		||||
		computed: {
 | 
			
		||||
			styles() {
 | 
			
		||||
				return `${this.size}${this.customStyle||''};` + (this.hidden && 'position: fixed; left: 1500rpx;')
 | 
			
		||||
			},
 | 
			
		||||
			canvasId() {
 | 
			
		||||
				return `l-painter${this._ && this._.uid || this._uid}`
 | 
			
		||||
			},
 | 
			
		||||
			size() {
 | 
			
		||||
				if (this.boardWidth && this.boardHeight) {
 | 
			
		||||
					return `width:${this.boardWidth}px; height: ${this.boardHeight}px;`;
 | 
			
		||||
				}
 | 
			
		||||
			},
 | 
			
		||||
			dpr() {
 | 
			
		||||
				return this.pixelRatio || uni.getSystemInfoSync().pixelRatio;
 | 
			
		||||
			},
 | 
			
		||||
			boardWidth() {
 | 
			
		||||
				const {width = 0} = (this.elements && this.elements.css) || this.elements || this
 | 
			
		||||
				const w = toPx(width||this.width)
 | 
			
		||||
				return w || Math.max(w, toPx(this.canvasWidth));
 | 
			
		||||
			},
 | 
			
		||||
			boardHeight() {
 | 
			
		||||
				const {height = 0} = (this.elements && this.elements.css) || this.elements || this
 | 
			
		||||
				const h = toPx(height||this.height)
 | 
			
		||||
				return h || Math.max(h, toPx(this.canvasHeight));
 | 
			
		||||
			},
 | 
			
		||||
			hasBoard() {
 | 
			
		||||
				return this.board && Object.keys(this.board).length
 | 
			
		||||
			},
 | 
			
		||||
			elements() {
 | 
			
		||||
				return this.hasBoard ? this.board : JSON.parse(JSON.stringify(this.el))
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		created() {
 | 
			
		||||
			this.use2dCanvas = this.type === '2d' && canIUseCanvas2d() && !isPC
 | 
			
		||||
		},
 | 
			
		||||
		async mounted() {
 | 
			
		||||
			await sleep(30)
 | 
			
		||||
			await this.getParentWeith()
 | 
			
		||||
			this.$nextTick(() => {
 | 
			
		||||
				setTimeout(() => {
 | 
			
		||||
					this.$watch('elements', this.watchRender, {
 | 
			
		||||
						deep: true,
 | 
			
		||||
						immediate: true
 | 
			
		||||
					});
 | 
			
		||||
				}, 30)
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		// #ifdef VUE3
 | 
			
		||||
		unmounted() {
 | 
			
		||||
			this.done = false
 | 
			
		||||
			this.inited = false
 | 
			
		||||
			this.firstRender = 0
 | 
			
		||||
			this.progress = 0
 | 
			
		||||
			this.painter = null
 | 
			
		||||
			clearTimeout(this.rendertimer)
 | 
			
		||||
		},
 | 
			
		||||
		// #endif
 | 
			
		||||
		// #ifdef VUE2
 | 
			
		||||
		destroyed() {
 | 
			
		||||
			this.done = false
 | 
			
		||||
			this.inited = false
 | 
			
		||||
			this.firstRender = 0
 | 
			
		||||
			this.progress = 0
 | 
			
		||||
			this.painter = null
 | 
			
		||||
			clearTimeout(this.rendertimer)
 | 
			
		||||
		},
 | 
			
		||||
		// #endif
 | 
			
		||||
		methods: {
 | 
			
		||||
			async watchRender(val, old) {
 | 
			
		||||
				if (!val || !val.views || (!this.firstRender ? !val.views.length : !this.firstRender) || !Object.keys(val).length || JSON.stringify(val) == JSON.stringify(old)) return;
 | 
			
		||||
				this.firstRender = 1
 | 
			
		||||
				this.progress = 0
 | 
			
		||||
				this.done = false
 | 
			
		||||
				clearTimeout(this.rendertimer)
 | 
			
		||||
				this.rendertimer = setTimeout(() => {
 | 
			
		||||
					this.render(val);
 | 
			
		||||
				}, this.beforeDelay)
 | 
			
		||||
			},
 | 
			
		||||
			async setFilePath(path, param) {
 | 
			
		||||
				let filePath = path
 | 
			
		||||
				const {pathType = this.pathType} =  param || this
 | 
			
		||||
				if (pathType == 'base64' && !isBase64(path)) {
 | 
			
		||||
					filePath = await pathToBase64(path)
 | 
			
		||||
				} else if (pathType == 'url' && isBase64(path)) {
 | 
			
		||||
					filePath = await base64ToPath(path)
 | 
			
		||||
				}
 | 
			
		||||
				if (param && param.isEmit) {
 | 
			
		||||
					this.$emit('success', filePath);
 | 
			
		||||
				}
 | 
			
		||||
				return filePath
 | 
			
		||||
			},
 | 
			
		||||
			async getSize(args) {
 | 
			
		||||
				const {width} = args.css || args
 | 
			
		||||
				const {height} = args.css || args
 | 
			
		||||
				if (!this.size) {
 | 
			
		||||
					if (width || height) {
 | 
			
		||||
						this.canvasWidth = width || this.canvasWidth
 | 
			
		||||
						this.canvasHeight = height || this.canvasHeight
 | 
			
		||||
						await sleep(30);
 | 
			
		||||
					} else {
 | 
			
		||||
						await this.getParentWeith()
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			},
 | 
			
		||||
			canvasToTempFilePathSync(args) {
 | 
			
		||||
				// this.stopWatch && this.stopWatch()
 | 
			
		||||
				// this.stopWatch = this.$watch('done', (v) => {
 | 
			
		||||
				// 	if (v) {
 | 
			
		||||
				// 		this.canvasToTempFilePath(args)
 | 
			
		||||
				// 		this.stopWatch && this.stopWatch()
 | 
			
		||||
				// 	}
 | 
			
		||||
				// }, {
 | 
			
		||||
				// 	immediate: true
 | 
			
		||||
				// })
 | 
			
		||||
				this.tasks.push(args)
 | 
			
		||||
				if(this.done){
 | 
			
		||||
					this.runTask()
 | 
			
		||||
				}
 | 
			
		||||
			},
 | 
			
		||||
			runTask(){
 | 
			
		||||
				while(this.tasks.length){
 | 
			
		||||
					const task = this.tasks.shift()	
 | 
			
		||||
					 this.canvasToTempFilePath(task)
 | 
			
		||||
				}
 | 
			
		||||
			},
 | 
			
		||||
			// #ifndef APP-NVUE
 | 
			
		||||
			getParentWeith() {
 | 
			
		||||
				return new Promise(resolve => {
 | 
			
		||||
					uni.createSelectorQuery()
 | 
			
		||||
						.in(this)
 | 
			
		||||
						.select(`.lime-painter`)
 | 
			
		||||
						.boundingClientRect()
 | 
			
		||||
						.exec(res => {
 | 
			
		||||
							const {width, height} = res[0]||{}
 | 
			
		||||
							this.parentWidth = Math.ceil(width||0)
 | 
			
		||||
							this.canvasWidth = this.parentWidth || 300
 | 
			
		||||
							this.canvasHeight = height || this.canvasHeight||150
 | 
			
		||||
							resolve(res[0])
 | 
			
		||||
						})
 | 
			
		||||
				})
 | 
			
		||||
			},
 | 
			
		||||
			async render(args = {}) {
 | 
			
		||||
				if(!Object.keys(args).length) {
 | 
			
		||||
					return console.error('空对象')
 | 
			
		||||
				}
 | 
			
		||||
				this.progress = 0
 | 
			
		||||
				this.done = false
 | 
			
		||||
				// #ifdef APP-NVUE
 | 
			
		||||
				this.tempFilePath.length = 0
 | 
			
		||||
				// #endif
 | 
			
		||||
				await this.getSize(args)
 | 
			
		||||
				const ctx = await this.getContext();
 | 
			
		||||
				
 | 
			
		||||
				let {
 | 
			
		||||
					use2dCanvas,
 | 
			
		||||
					boardWidth,
 | 
			
		||||
					boardHeight,
 | 
			
		||||
					canvas,
 | 
			
		||||
					afterDelay
 | 
			
		||||
				} = this;
 | 
			
		||||
				if (use2dCanvas && !canvas) {
 | 
			
		||||
					return Promise.reject(new Error('canvas 没创建'));
 | 
			
		||||
				}
 | 
			
		||||
				this.boundary = {
 | 
			
		||||
					top: 0,
 | 
			
		||||
					left: 0,
 | 
			
		||||
					width: boardWidth,
 | 
			
		||||
					height: boardHeight
 | 
			
		||||
				};
 | 
			
		||||
				this.painter = null
 | 
			
		||||
				if (!this.painter) {
 | 
			
		||||
					const {width} = args.css || args
 | 
			
		||||
					const {height} = args.css || args
 | 
			
		||||
					if(!width && this.parentWidth) {
 | 
			
		||||
						Object.assign(args, {width: this.parentWidth})
 | 
			
		||||
					}
 | 
			
		||||
					const param = {
 | 
			
		||||
						context: ctx,
 | 
			
		||||
						canvas,
 | 
			
		||||
						width: boardWidth,
 | 
			
		||||
						height: boardHeight,
 | 
			
		||||
						pixelRatio: this.dpr,
 | 
			
		||||
						useCORS: this.useCORS,
 | 
			
		||||
						createImage: getImageInfo.bind(this),
 | 
			
		||||
						performance: this.performance,
 | 
			
		||||
						listen: {
 | 
			
		||||
							onProgress: (v) => {
 | 
			
		||||
								this.progress = v
 | 
			
		||||
								this.$emit('progress', v)
 | 
			
		||||
							},
 | 
			
		||||
							onEffectFail: (err) => {
 | 
			
		||||
								this.$emit('faill', err)
 | 
			
		||||
							}
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					this.painter = new Painter(param)
 | 
			
		||||
				} 
 | 
			
		||||
				try{
 | 
			
		||||
					// vue3 赋值给data会引起图片无法绘制
 | 
			
		||||
					const { width, height } = await this.painter.source(JSON.parse(JSON.stringify(args)))
 | 
			
		||||
					this.boundary.height = this.canvasHeight = height
 | 
			
		||||
					this.boundary.width = this.canvasWidth = width
 | 
			
		||||
					await sleep(this.sleep);
 | 
			
		||||
					await this.painter.render()
 | 
			
		||||
					await new Promise(resolve => this.$nextTick(resolve));
 | 
			
		||||
					if (!use2dCanvas) {
 | 
			
		||||
						await this.canvasDraw();
 | 
			
		||||
					}
 | 
			
		||||
					if (afterDelay && use2dCanvas) {
 | 
			
		||||
						await sleep(afterDelay);
 | 
			
		||||
					}
 | 
			
		||||
					this.$emit('done');
 | 
			
		||||
					this.done = true
 | 
			
		||||
					if (this.isCanvasToTempFilePath) {
 | 
			
		||||
						this.canvasToTempFilePath()
 | 
			
		||||
							.then(res => {
 | 
			
		||||
								this.$emit('success', res.tempFilePath)
 | 
			
		||||
							})
 | 
			
		||||
							.catch(err => {
 | 
			
		||||
								this.$emit('fail', new Error(JSON.stringify(err)));
 | 
			
		||||
							});
 | 
			
		||||
					}
 | 
			
		||||
					this.runTask()
 | 
			
		||||
					return Promise.resolve({
 | 
			
		||||
						ctx,
 | 
			
		||||
						draw: this.painter,
 | 
			
		||||
						node: this.node
 | 
			
		||||
					});
 | 
			
		||||
				}catch(e){
 | 
			
		||||
					//TODO handle the exception
 | 
			
		||||
				}
 | 
			
		||||
				
 | 
			
		||||
			},
 | 
			
		||||
			canvasDraw(flag = false) {
 | 
			
		||||
				return new Promise((resolve, reject) => this.ctx.draw(flag, () => setTimeout(() => resolve(), this
 | 
			
		||||
					.afterDelay)));
 | 
			
		||||
			},
 | 
			
		||||
			async getContext() {
 | 
			
		||||
				if (!this.canvasWidth) {
 | 
			
		||||
					this.$emit('fail', 'painter no size')
 | 
			
		||||
					console.error('[lime-painter]: 给画板或父级设置尺寸')
 | 
			
		||||
					return Promise.reject();
 | 
			
		||||
				}
 | 
			
		||||
				if (this.ctx && this.inited) {
 | 
			
		||||
					return Promise.resolve(this.ctx);
 | 
			
		||||
				}
 | 
			
		||||
				const { type, use2dCanvas, dpr, boardWidth, boardHeight } = this;
 | 
			
		||||
				const _getContext = () => {
 | 
			
		||||
					return new Promise(resolve => {
 | 
			
		||||
						uni.createSelectorQuery()
 | 
			
		||||
							.in(this)
 | 
			
		||||
							.select(`#${this.canvasId}`)
 | 
			
		||||
							.boundingClientRect()
 | 
			
		||||
							.exec(res => {
 | 
			
		||||
								if (res) {
 | 
			
		||||
									const ctx = uni.createCanvasContext(this.canvasId, this);
 | 
			
		||||
									if (!this.inited) {
 | 
			
		||||
										this.inited = true;
 | 
			
		||||
										this.use2dCanvas = false;
 | 
			
		||||
										this.canvas = res;
 | 
			
		||||
									}
 | 
			
		||||
									
 | 
			
		||||
									// 钉钉小程序框架不支持 measureText 方法,用此方法 mock
 | 
			
		||||
									if (!ctx.measureText) {
 | 
			
		||||
										function strLen(str) {
 | 
			
		||||
											let len = 0;
 | 
			
		||||
											for (let i = 0; i < str.length; i++) {
 | 
			
		||||
												if (str.charCodeAt(i) > 0 && str.charCodeAt(i) < 128) {
 | 
			
		||||
													len++;
 | 
			
		||||
												} else {
 | 
			
		||||
													len += 2;
 | 
			
		||||
												}
 | 
			
		||||
											}
 | 
			
		||||
											return len;
 | 
			
		||||
										}
 | 
			
		||||
										ctx.measureText = text => {
 | 
			
		||||
											let fontSize = ctx.state && ctx.state.fontSize || 12;
 | 
			
		||||
											const font = ctx.__font
 | 
			
		||||
											if (font && fontSize == 12) {
 | 
			
		||||
												fontSize = parseInt(font.split(' ')[3], 10);
 | 
			
		||||
											}
 | 
			
		||||
											fontSize /= 2;
 | 
			
		||||
											return {
 | 
			
		||||
												width: strLen(text) * fontSize
 | 
			
		||||
											};
 | 
			
		||||
										}
 | 
			
		||||
									}
 | 
			
		||||
									
 | 
			
		||||
									// #ifdef MP-ALIPAY
 | 
			
		||||
									ctx.scale(dpr, dpr);
 | 
			
		||||
									// #endif
 | 
			
		||||
									this.ctx = ctx
 | 
			
		||||
									resolve(this.ctx);
 | 
			
		||||
								} else {
 | 
			
		||||
									console.error('[lime-painter] no node')
 | 
			
		||||
								}
 | 
			
		||||
							});
 | 
			
		||||
					});
 | 
			
		||||
				};
 | 
			
		||||
				if (!use2dCanvas) {
 | 
			
		||||
					return _getContext();
 | 
			
		||||
				}
 | 
			
		||||
				return new Promise(resolve => {
 | 
			
		||||
					uni.createSelectorQuery()
 | 
			
		||||
						.in(this)
 | 
			
		||||
						.select(`#${this.canvasId}`)
 | 
			
		||||
						.node()
 | 
			
		||||
						.exec(res => {
 | 
			
		||||
							let {node: canvas} = res && res[0]||{};
 | 
			
		||||
							if(canvas) {
 | 
			
		||||
								const ctx = canvas.getContext(type);
 | 
			
		||||
								if (!this.inited) {
 | 
			
		||||
									this.inited = true;
 | 
			
		||||
									this.use2dCanvas = true;
 | 
			
		||||
									this.canvas = canvas;
 | 
			
		||||
								}
 | 
			
		||||
								this.ctx = ctx
 | 
			
		||||
								resolve(this.ctx);
 | 
			
		||||
							} else {
 | 
			
		||||
								console.error('[lime-painter]: no size')
 | 
			
		||||
							}
 | 
			
		||||
						});
 | 
			
		||||
				});
 | 
			
		||||
			},
 | 
			
		||||
			canvasToTempFilePath(args = {}) {
 | 
			
		||||
				return new Promise(async (resolve, reject) => {
 | 
			
		||||
					const { use2dCanvas, canvasId, dpr, fileType, quality } = this;
 | 
			
		||||
					const success = async (res) => {
 | 
			
		||||
						try {
 | 
			
		||||
							const tempFilePath = await this.setFilePath(res.tempFilePath || res, args)
 | 
			
		||||
							const result = Object.assign(res, {tempFilePath})
 | 
			
		||||
							args.success && args.success(result)
 | 
			
		||||
							resolve(result)
 | 
			
		||||
						} catch (e) {
 | 
			
		||||
							this.$emit('fail', e)
 | 
			
		||||
						}
 | 
			
		||||
					}
 | 
			
		||||
					
 | 
			
		||||
					let { top: y = 0, left: x = 0, width, height } = this.boundary || this;
 | 
			
		||||
					// let destWidth = width * dpr;
 | 
			
		||||
					// let destHeight = height * dpr;
 | 
			
		||||
					// #ifdef MP-ALIPAY
 | 
			
		||||
					// width = destWidth;
 | 
			
		||||
					// height = destHeight;
 | 
			
		||||
					// #endif
 | 
			
		||||
					
 | 
			
		||||
					const copyArgs = Object.assign({
 | 
			
		||||
						// x,
 | 
			
		||||
						// y,
 | 
			
		||||
						// width,
 | 
			
		||||
						// height,
 | 
			
		||||
						// destWidth,
 | 
			
		||||
						// destHeight,
 | 
			
		||||
						canvasId,
 | 
			
		||||
						id: canvasId,
 | 
			
		||||
						fileType,
 | 
			
		||||
						quality,
 | 
			
		||||
					}, args, {success});
 | 
			
		||||
					// if(this.isPC || use2dCanvas) {
 | 
			
		||||
					// 	copyArgs.canvas = this.canvas
 | 
			
		||||
					// }
 | 
			
		||||
					if (use2dCanvas) {
 | 
			
		||||
						copyArgs.canvas = this.canvas
 | 
			
		||||
						try{
 | 
			
		||||
							// #ifndef MP-ALIPAY
 | 
			
		||||
							const oFilePath = this.canvas.toDataURL(`image/${args.fileType||fileType}`.replace(/pg/, 'peg'), args.quality||quality)
 | 
			
		||||
							if(/data:,/.test(oFilePath)) {
 | 
			
		||||
								uni.canvasToTempFilePath(copyArgs, this);
 | 
			
		||||
							} else {
 | 
			
		||||
								const tempFilePath = await this.setFilePath(oFilePath, args)
 | 
			
		||||
								args.success && args.success({tempFilePath})
 | 
			
		||||
								resolve({tempFilePath})
 | 
			
		||||
							}
 | 
			
		||||
							// #endif
 | 
			
		||||
							// #ifdef MP-ALIPAY
 | 
			
		||||
							this.canvas.toTempFilePath(copyArgs)
 | 
			
		||||
							// #endif
 | 
			
		||||
						}catch(e){
 | 
			
		||||
							args.fail && args.fail(e)
 | 
			
		||||
							reject(e)
 | 
			
		||||
						}
 | 
			
		||||
					} else {
 | 
			
		||||
						// #ifdef MP-ALIPAY
 | 
			
		||||
						if(this.ctx.toTempFilePath) {
 | 
			
		||||
							// 钉钉
 | 
			
		||||
							const ctx = uni.createCanvasContext(canvasId);
 | 
			
		||||
							ctx.toTempFilePath(copyArgs);
 | 
			
		||||
						} else {
 | 
			
		||||
							my.canvasToTempFilePath(copyArgs);
 | 
			
		||||
						}
 | 
			
		||||
						// #endif
 | 
			
		||||
						// #ifndef MP-ALIPAY
 | 
			
		||||
						uni.canvasToTempFilePath(copyArgs, this);
 | 
			
		||||
						// #endif
 | 
			
		||||
					}
 | 
			
		||||
				})
 | 
			
		||||
			}
 | 
			
		||||
			// #endif
 | 
			
		||||
		}
 | 
			
		||||
	};
 | 
			
		||||
</script>
 | 
			
		||||
<style>
 | 
			
		||||
	.lime-painter,
 | 
			
		||||
	.lime-painter__canvas {
 | 
			
		||||
		// #ifndef APP-NVUE
 | 
			
		||||
		width: 100%;
 | 
			
		||||
		// #endif
 | 
			
		||||
		// #ifdef APP-NVUE
 | 
			
		||||
		flex: 1;
 | 
			
		||||
		// #endif
 | 
			
		||||
	}
 | 
			
		||||
</style>
 | 
			
		||||
							
								
								
									
										214
									
								
								uni_modules/lime-painter/components/l-painter/nvue.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						@ -0,0 +1,214 @@
 | 
			
		||||
// #ifdef APP-NVUE
 | 
			
		||||
import {
 | 
			
		||||
	sleep,
 | 
			
		||||
	getImageInfo,
 | 
			
		||||
	isBase64,
 | 
			
		||||
	networkReg
 | 
			
		||||
} from './utils';
 | 
			
		||||
const dom = weex.requireModule('dom')
 | 
			
		||||
import {
 | 
			
		||||
	version
 | 
			
		||||
} from '../../package.json'
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
	data() {
 | 
			
		||||
		return {
 | 
			
		||||
			tempFilePath: [],
 | 
			
		||||
			isInitFile: false,
 | 
			
		||||
			osName: uni.getSystemInfoSync().osName
 | 
			
		||||
		}
 | 
			
		||||
	},
 | 
			
		||||
	methods: {
 | 
			
		||||
		getParentWeith() {
 | 
			
		||||
			return new Promise(resolve => {
 | 
			
		||||
				dom.getComponentRect(this.$refs.limepainter, (res) => {
 | 
			
		||||
					this.parentWidth = Math.ceil(res.size.width)
 | 
			
		||||
					this.canvasWidth = this.canvasWidth || this.parentWidth || 300
 | 
			
		||||
					this.canvasHeight = res.size.height || this.canvasHeight || 150
 | 
			
		||||
					resolve(res.size)
 | 
			
		||||
				})
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		onPageFinish() {
 | 
			
		||||
			this.webview = this.$refs.webview
 | 
			
		||||
			this.webview.evalJS(`init(${this.dpr})`)
 | 
			
		||||
		},
 | 
			
		||||
		onMessage(e) {
 | 
			
		||||
			const res = e.detail.data[0] || null;
 | 
			
		||||
			if (res.event) {
 | 
			
		||||
				if (res.event == 'inited') {
 | 
			
		||||
					this.inited = true
 | 
			
		||||
				}
 | 
			
		||||
				if (res.event == 'fail') {
 | 
			
		||||
					this.$emit('fail', res)
 | 
			
		||||
				}
 | 
			
		||||
				if (res.event == 'layoutChange') {
 | 
			
		||||
					const data = typeof res.data == 'string' ? JSON.parse(res.data) : res.data
 | 
			
		||||
					this.canvasWidth = Math.ceil(data.width);
 | 
			
		||||
					this.canvasHeight = Math.ceil(data.height);
 | 
			
		||||
				}
 | 
			
		||||
				if (res.event == 'progressChange') {
 | 
			
		||||
					this.progress = res.data * 1
 | 
			
		||||
				}
 | 
			
		||||
				if (res.event == 'file') {
 | 
			
		||||
					this.tempFilePath.push(res.data)
 | 
			
		||||
					if (this.tempFilePath.length > 7) {
 | 
			
		||||
						this.tempFilePath.shift()
 | 
			
		||||
					}
 | 
			
		||||
					return
 | 
			
		||||
				}
 | 
			
		||||
				if (res.event == 'success') {
 | 
			
		||||
					if (res.data) {
 | 
			
		||||
						this.tempFilePath.push(res.data)
 | 
			
		||||
						if (this.tempFilePath.length > 8) {
 | 
			
		||||
							this.tempFilePath.shift()
 | 
			
		||||
						}
 | 
			
		||||
						if (this.isCanvasToTempFilePath) {
 | 
			
		||||
							this.setFilePath(this.tempFilePath.join(''), {
 | 
			
		||||
								isEmit: true
 | 
			
		||||
							})
 | 
			
		||||
						}
 | 
			
		||||
					} else {
 | 
			
		||||
						this.$emit('fail', 'canvas no data')
 | 
			
		||||
					}
 | 
			
		||||
					return
 | 
			
		||||
				}
 | 
			
		||||
				this.$emit(res.event, JSON.parse(res.data));
 | 
			
		||||
			} else if (res.file) {
 | 
			
		||||
				this.file = res.data;
 | 
			
		||||
			} else {
 | 
			
		||||
				console.info(res[0])
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		getWebViewInited() {
 | 
			
		||||
			if (this.inited) return Promise.resolve(this.inited);
 | 
			
		||||
			return new Promise((resolve) => {
 | 
			
		||||
				this.$watch(
 | 
			
		||||
					'inited',
 | 
			
		||||
					async val => {
 | 
			
		||||
						if (val) {
 | 
			
		||||
							resolve(val)
 | 
			
		||||
						}
 | 
			
		||||
					}, {
 | 
			
		||||
						immediate: true
 | 
			
		||||
					}
 | 
			
		||||
				);
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		getTempFilePath() {
 | 
			
		||||
			if (this.tempFilePath.length == 8) return Promise.resolve(this.tempFilePath)
 | 
			
		||||
			return new Promise((resolve) => {
 | 
			
		||||
				this.$watch(
 | 
			
		||||
					'tempFilePath',
 | 
			
		||||
					async val => {
 | 
			
		||||
						if (val.length == 8) {
 | 
			
		||||
							resolve(val.join(''))
 | 
			
		||||
						}
 | 
			
		||||
					}, {
 | 
			
		||||
						deep: true
 | 
			
		||||
					}
 | 
			
		||||
				);
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		getWebViewDone() {
 | 
			
		||||
			if (this.progress == 1) return Promise.resolve(this.progress);
 | 
			
		||||
			return new Promise((resolve) => {
 | 
			
		||||
				this.$watch(
 | 
			
		||||
					'progress',
 | 
			
		||||
					async val => {
 | 
			
		||||
						if (val == 1) {
 | 
			
		||||
							this.$emit('done')
 | 
			
		||||
							this.done = true
 | 
			
		||||
							this.runTask()
 | 
			
		||||
							resolve(val)
 | 
			
		||||
						}
 | 
			
		||||
					}, {
 | 
			
		||||
						immediate: true
 | 
			
		||||
					}
 | 
			
		||||
				);
 | 
			
		||||
			})
 | 
			
		||||
		},
 | 
			
		||||
		async render(args) {
 | 
			
		||||
			try {
 | 
			
		||||
				await this.getSize(args)
 | 
			
		||||
				const {
 | 
			
		||||
					width
 | 
			
		||||
				} = args.css || args
 | 
			
		||||
				if (!width && this.parentWidth) {
 | 
			
		||||
					Object.assign(args, {
 | 
			
		||||
						width: this.parentWidth
 | 
			
		||||
					})
 | 
			
		||||
				}
 | 
			
		||||
				const newNode = await this.calcImage(args);
 | 
			
		||||
				await this.getWebViewInited()
 | 
			
		||||
				this.webview.evalJS(`source(${JSON.stringify(newNode)})`)
 | 
			
		||||
				await this.getWebViewDone()
 | 
			
		||||
				await sleep(this.afterDelay)
 | 
			
		||||
				if (this.isCanvasToTempFilePath) {
 | 
			
		||||
					const params = {
 | 
			
		||||
						fileType: this.fileType,
 | 
			
		||||
						quality: this.quality
 | 
			
		||||
					}
 | 
			
		||||
					this.webview.evalJS(`save(${JSON.stringify(params)})`)
 | 
			
		||||
				}
 | 
			
		||||
				return Promise.resolve()
 | 
			
		||||
			} catch (e) {
 | 
			
		||||
				this.$emit('fail', e)
 | 
			
		||||
			}
 | 
			
		||||
		},
 | 
			
		||||
		async calcImage(args) {
 | 
			
		||||
			let node = JSON.parse(JSON.stringify(args))
 | 
			
		||||
			const urlReg = /url\((.+)\)/
 | 
			
		||||
			const {
 | 
			
		||||
				backgroundImage
 | 
			
		||||
			} = node.css || {}
 | 
			
		||||
			const isBG = backgroundImage && urlReg.exec(backgroundImage)[1]
 | 
			
		||||
			const url = node.url || node.src || isBG
 | 
			
		||||
			if (['text', 'qrcode'].includes(node.type)) {
 | 
			
		||||
				return node
 | 
			
		||||
			}
 | 
			
		||||
			if ((node.type === "image" || isBG) && url && !isBase64(url) && (this.osName == 'ios' || !networkReg
 | 
			
		||||
					.test(url))) {
 | 
			
		||||
				let {
 | 
			
		||||
					path
 | 
			
		||||
				} = await getImageInfo(url, true)
 | 
			
		||||
				if (isBG) {
 | 
			
		||||
					node.css.backgroundImage = `url(${path})`
 | 
			
		||||
				} else {
 | 
			
		||||
					node.src = path
 | 
			
		||||
				}
 | 
			
		||||
			} else if (node.views && node.views.length) {
 | 
			
		||||
				for (let i = 0; i < node.views.length; i++) {
 | 
			
		||||
					node.views[i] = await this.calcImage(node.views[i])
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
			return node
 | 
			
		||||
		},
 | 
			
		||||
		async canvasToTempFilePath(args = {}) {
 | 
			
		||||
			if (!this.inited) {
 | 
			
		||||
				return this.$emit('fail', 'no init')
 | 
			
		||||
			}
 | 
			
		||||
			this.tempFilePath = []
 | 
			
		||||
			if (args.fileType == 'jpg') {
 | 
			
		||||
				args.fileType = 'jpeg'
 | 
			
		||||
			}
 | 
			
		||||
 | 
			
		||||
			this.webview.evalJS(`save(${JSON.stringify(args)})`)
 | 
			
		||||
			try {
 | 
			
		||||
				let tempFilePath = await this.getTempFilePath()
 | 
			
		||||
 | 
			
		||||
				tempFilePath = await this.setFilePath(tempFilePath, args)
 | 
			
		||||
				args.success({
 | 
			
		||||
					errMsg: "canvasToTempFilePath:ok",
 | 
			
		||||
					tempFilePath
 | 
			
		||||
				})
 | 
			
		||||
			} catch (e) {
 | 
			
		||||
				console.log('e', e)
 | 
			
		||||
				args.fail({
 | 
			
		||||
					error: e
 | 
			
		||||
				})
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
// #endif
 | 
			
		||||
							
								
								
									
										1
									
								
								uni_modules/lime-painter/components/l-painter/painter.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										56
									
								
								uni_modules/lime-painter/components/l-painter/props.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						@ -0,0 +1,56 @@
 | 
			
		||||
export default {
 | 
			
		||||
	props: {
 | 
			
		||||
		board: Object,
 | 
			
		||||
		pathType: String, // 'base64'、'url'
 | 
			
		||||
		fileType: {
 | 
			
		||||
			type: String,
 | 
			
		||||
			default: 'png'
 | 
			
		||||
		},
 | 
			
		||||
		hidden: Boolean,
 | 
			
		||||
		quality: {
 | 
			
		||||
			type: Number,
 | 
			
		||||
			default: 1
 | 
			
		||||
		},
 | 
			
		||||
		css: [String, Object],
 | 
			
		||||
		// styles: [String, Object],
 | 
			
		||||
		width: [Number, String],
 | 
			
		||||
		height: [Number, String],
 | 
			
		||||
		pixelRatio: Number,
 | 
			
		||||
		customStyle: String,
 | 
			
		||||
		isCanvasToTempFilePath: Boolean,
 | 
			
		||||
		// useCanvasToTempFilePath: Boolean,
 | 
			
		||||
		sleep: {
 | 
			
		||||
			type: Number,
 | 
			
		||||
			default: 1000 / 30
 | 
			
		||||
		},
 | 
			
		||||
		beforeDelay: {
 | 
			
		||||
			type: Number,
 | 
			
		||||
			default: 100
 | 
			
		||||
		},
 | 
			
		||||
		afterDelay: {
 | 
			
		||||
			type: Number,
 | 
			
		||||
			default: 100
 | 
			
		||||
		},
 | 
			
		||||
		performance: Boolean,
 | 
			
		||||
		// #ifdef MP-WEIXIN || MP-TOUTIAO || MP-ALIPAY
 | 
			
		||||
		type: {
 | 
			
		||||
			type: String,
 | 
			
		||||
			default: '2d'
 | 
			
		||||
		},
 | 
			
		||||
		// #endif
 | 
			
		||||
		// #ifdef APP-NVUE
 | 
			
		||||
		hybrid: Boolean,
 | 
			
		||||
		timeout: {
 | 
			
		||||
			type: Number,
 | 
			
		||||
			default: 2000
 | 
			
		||||
		},
 | 
			
		||||
		// #endif
 | 
			
		||||
		// #ifdef H5 || APP-PLUS
 | 
			
		||||
		useCORS: Boolean,
 | 
			
		||||
		hidpi: {
 | 
			
		||||
			type: Boolean,
 | 
			
		||||
			default: true
 | 
			
		||||
		}
 | 
			
		||||
		// #endif
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										1
									
								
								uni_modules/lime-painter/components/l-painter/single.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										368
									
								
								uni_modules/lime-painter/components/l-painter/utils.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						@ -0,0 +1,368 @@
 | 
			
		||||
export const networkReg = /^(http|\/\/)/;
 | 
			
		||||
export const isBase64 = (path) => /^data:image\/(\w+);base64/.test(path);
 | 
			
		||||
export function sleep(delay) {
 | 
			
		||||
	return new Promise(resolve => setTimeout(resolve, delay))
 | 
			
		||||
}
 | 
			
		||||
let {platform, SDKVersion} = uni.getSystemInfoSync() 
 | 
			
		||||
export const isPC = /windows|mac/.test(platform)
 | 
			
		||||
// 缓存图片
 | 
			
		||||
let cache = {}
 | 
			
		||||
export function isNumber(value) {
 | 
			
		||||
	return /^-?\d+(\.\d+)?$/.test(value);
 | 
			
		||||
}
 | 
			
		||||
export function toPx(value, baseSize, isDecimal = false) {
 | 
			
		||||
	// 如果是数字
 | 
			
		||||
	if (typeof value === 'number') {
 | 
			
		||||
		return value
 | 
			
		||||
	}
 | 
			
		||||
	// 如果是字符串数字
 | 
			
		||||
	if (isNumber(value)) {
 | 
			
		||||
		return value * 1
 | 
			
		||||
	}
 | 
			
		||||
	// 如果有单位
 | 
			
		||||
	if (typeof value === 'string') {
 | 
			
		||||
		const reg = /^-?([0-9]+)?([.]{1}[0-9]+){0,1}(em|rpx|px|%)$/g
 | 
			
		||||
		const results = reg.exec(value);
 | 
			
		||||
		if (!value || !results) {
 | 
			
		||||
			return 0;
 | 
			
		||||
		}
 | 
			
		||||
		const unit = results[3];
 | 
			
		||||
		value = parseFloat(value);
 | 
			
		||||
		let res = 0;
 | 
			
		||||
		if (unit === 'rpx') {
 | 
			
		||||
			res = uni.upx2px(value);
 | 
			
		||||
		} else if (unit === 'px') {
 | 
			
		||||
			res = value * 1;
 | 
			
		||||
		} else if (unit === '%') {
 | 
			
		||||
			res = value * toPx(baseSize) / 100;
 | 
			
		||||
		} else if (unit === 'em') {
 | 
			
		||||
			res = value * toPx(baseSize || 14);
 | 
			
		||||
		}
 | 
			
		||||
		return isDecimal ? res.toFixed(2) * 1 : Math.round(res);
 | 
			
		||||
	}
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// 计算版本
 | 
			
		||||
export function compareVersion(v1, v2) {
 | 
			
		||||
	v1 = v1.split('.')
 | 
			
		||||
	v2 = v2.split('.')
 | 
			
		||||
	const len = Math.max(v1.length, v2.length)
 | 
			
		||||
	while (v1.length < len) {
 | 
			
		||||
		v1.push('0')
 | 
			
		||||
	}
 | 
			
		||||
	while (v2.length < len) {
 | 
			
		||||
		v2.push('0')
 | 
			
		||||
	}
 | 
			
		||||
	for (let i = 0; i < len; i++) {
 | 
			
		||||
		const num1 = parseInt(v1[i], 10)
 | 
			
		||||
		const num2 = parseInt(v2[i], 10)
 | 
			
		||||
 | 
			
		||||
		if (num1 > num2) {
 | 
			
		||||
			return 1
 | 
			
		||||
		} else if (num1 < num2) {
 | 
			
		||||
			return -1
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return 0
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function gte(version) {
 | 
			
		||||
  // #ifdef MP-ALIPAY
 | 
			
		||||
  SDKVersion = my.SDKVersion
 | 
			
		||||
  // #endif
 | 
			
		||||
  return compareVersion(SDKVersion, version) >= 0;
 | 
			
		||||
}
 | 
			
		||||
export function canIUseCanvas2d() {
 | 
			
		||||
	// #ifdef MP-WEIXIN
 | 
			
		||||
	return gte('2.9.2');
 | 
			
		||||
	// #endif
 | 
			
		||||
	// #ifdef MP-ALIPAY
 | 
			
		||||
	return gte('2.7.15');
 | 
			
		||||
	// #endif
 | 
			
		||||
	// #ifdef MP-TOUTIAO
 | 
			
		||||
	return gte('1.78.0');
 | 
			
		||||
	// #endif
 | 
			
		||||
	return false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// #ifdef MP
 | 
			
		||||
export const prefix = () => {
 | 
			
		||||
	// #ifdef MP-TOUTIAO
 | 
			
		||||
	return tt
 | 
			
		||||
	// #endif
 | 
			
		||||
	// #ifdef MP-WEIXIN
 | 
			
		||||
	return wx
 | 
			
		||||
	// #endif
 | 
			
		||||
	// #ifdef MP-BAIDU
 | 
			
		||||
	return swan
 | 
			
		||||
	// #endif
 | 
			
		||||
	// #ifdef MP-ALIPAY
 | 
			
		||||
	return my
 | 
			
		||||
	// #endif
 | 
			
		||||
	// #ifdef MP-QQ
 | 
			
		||||
	return qq
 | 
			
		||||
	// #endif
 | 
			
		||||
	// #ifdef MP-360
 | 
			
		||||
	return qh
 | 
			
		||||
	// #endif
 | 
			
		||||
}
 | 
			
		||||
// #endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * base64转路径
 | 
			
		||||
 * @param {Object} base64
 | 
			
		||||
 */
 | 
			
		||||
export function base64ToPath(base64) {
 | 
			
		||||
	const [, format] = /^data:image\/(\w+);base64,/.exec(base64) || [];
 | 
			
		||||
 | 
			
		||||
	return new Promise((resolve, reject) => {
 | 
			
		||||
		// #ifdef MP
 | 
			
		||||
		const fs = uni.getFileSystemManager()
 | 
			
		||||
		//自定义文件名
 | 
			
		||||
		if (!format) {
 | 
			
		||||
			reject(new Error('ERROR_BASE64SRC_PARSE'))
 | 
			
		||||
		}
 | 
			
		||||
		const time = new Date().getTime();
 | 
			
		||||
		let pre = prefix()
 | 
			
		||||
		// #ifdef MP-TOUTIAO
 | 
			
		||||
		const filePath = `${pre.getEnvInfoSync().common.USER_DATA_PATH}/${time}.${format}`
 | 
			
		||||
		// #endif
 | 
			
		||||
		// #ifndef MP-TOUTIAO
 | 
			
		||||
		const filePath = `${pre.env.USER_DATA_PATH}/${time}.${format}`
 | 
			
		||||
		// #endif
 | 
			
		||||
		fs.writeFile({
 | 
			
		||||
			filePath,
 | 
			
		||||
			data: base64.split(',')[1],
 | 
			
		||||
			encoding: 'base64',
 | 
			
		||||
			success() {
 | 
			
		||||
				resolve(filePath)
 | 
			
		||||
			},
 | 
			
		||||
			fail(err) {
 | 
			
		||||
				console.error(err)
 | 
			
		||||
				reject(err)
 | 
			
		||||
			}
 | 
			
		||||
		})
 | 
			
		||||
		// #endif
 | 
			
		||||
 | 
			
		||||
		// #ifdef H5
 | 
			
		||||
		// mime类型
 | 
			
		||||
		let mimeString = base64.split(',')[0].split(':')[1].split(';')[0];
 | 
			
		||||
		//base64 解码
 | 
			
		||||
		let byteString = atob(base64.split(',')[1]);
 | 
			
		||||
		//创建缓冲数组
 | 
			
		||||
		let arrayBuffer = new ArrayBuffer(byteString.length);
 | 
			
		||||
		//创建视图
 | 
			
		||||
		let intArray = new Uint8Array(arrayBuffer);
 | 
			
		||||
		for (let i = 0; i < byteString.length; i++) {
 | 
			
		||||
			intArray[i] = byteString.charCodeAt(i);
 | 
			
		||||
		}
 | 
			
		||||
		resolve(URL.createObjectURL(new Blob([intArray], {
 | 
			
		||||
			type: mimeString
 | 
			
		||||
		})))
 | 
			
		||||
		// #endif
 | 
			
		||||
 | 
			
		||||
		// #ifdef APP-PLUS
 | 
			
		||||
		const bitmap = new plus.nativeObj.Bitmap('bitmap' + Date.now())
 | 
			
		||||
		bitmap.loadBase64Data(base64, () => {
 | 
			
		||||
			if (!format) {
 | 
			
		||||
				reject(new Error('ERROR_BASE64SRC_PARSE'))
 | 
			
		||||
			}
 | 
			
		||||
			const time = new Date().getTime();
 | 
			
		||||
			const filePath = `_doc/uniapp_temp/${time}.${format}`
 | 
			
		||||
			bitmap.save(filePath, {},
 | 
			
		||||
				() => {
 | 
			
		||||
					bitmap.clear()
 | 
			
		||||
					resolve(filePath)
 | 
			
		||||
				},
 | 
			
		||||
				(error) => {
 | 
			
		||||
					bitmap.clear()
 | 
			
		||||
					reject(error)
 | 
			
		||||
				})
 | 
			
		||||
		}, (error) => {
 | 
			
		||||
			bitmap.clear()
 | 
			
		||||
			reject(error)
 | 
			
		||||
		})
 | 
			
		||||
		// #endif
 | 
			
		||||
	})
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * 路径转base64
 | 
			
		||||
 * @param {Object} string
 | 
			
		||||
 */
 | 
			
		||||
export function pathToBase64(path) {
 | 
			
		||||
	if (/^data:/.test(path)) return path
 | 
			
		||||
	return new Promise((resolve, reject) => {
 | 
			
		||||
		// #ifdef H5
 | 
			
		||||
		let image = new Image();
 | 
			
		||||
		image.setAttribute("crossOrigin", 'Anonymous');
 | 
			
		||||
		image.onload = function() {
 | 
			
		||||
			let canvas = document.createElement('canvas');
 | 
			
		||||
			canvas.width = this.naturalWidth;
 | 
			
		||||
			canvas.height = this.naturalHeight;
 | 
			
		||||
			canvas.getContext('2d').drawImage(image, 0, 0);
 | 
			
		||||
			let result = canvas.toDataURL('image/png')
 | 
			
		||||
			resolve(result);
 | 
			
		||||
			canvas.height = canvas.width = 0
 | 
			
		||||
		}
 | 
			
		||||
		image.src = path + '?v=' + Math.random()
 | 
			
		||||
		image.onerror = (error) => {
 | 
			
		||||
			reject(error);
 | 
			
		||||
		};
 | 
			
		||||
		// #endif
 | 
			
		||||
 | 
			
		||||
		// #ifdef MP
 | 
			
		||||
		if (uni.canIUse('getFileSystemManager')) {
 | 
			
		||||
			uni.getFileSystemManager().readFile({
 | 
			
		||||
				filePath: path,
 | 
			
		||||
				encoding: 'base64',
 | 
			
		||||
				success: (res) => {
 | 
			
		||||
					resolve('data:image/png;base64,' + res.data)
 | 
			
		||||
				},
 | 
			
		||||
				fail: (error) => {
 | 
			
		||||
					console.error({error, path})
 | 
			
		||||
					reject(error)
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
		}
 | 
			
		||||
		// #endif
 | 
			
		||||
 | 
			
		||||
		// #ifdef APP-PLUS
 | 
			
		||||
		plus.io.resolveLocalFileSystemURL(getLocalFilePath(path), (entry) => {
 | 
			
		||||
			entry.file((file) => {
 | 
			
		||||
				const fileReader = new plus.io.FileReader()
 | 
			
		||||
				fileReader.onload = (data) => {
 | 
			
		||||
					resolve(data.target.result)
 | 
			
		||||
				}
 | 
			
		||||
				fileReader.onerror = (error) => {
 | 
			
		||||
					reject(error)
 | 
			
		||||
				}
 | 
			
		||||
				fileReader.readAsDataURL(file)
 | 
			
		||||
			}, reject)
 | 
			
		||||
		}, reject)
 | 
			
		||||
		// #endif
 | 
			
		||||
	})
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
export function getImageInfo(path, useCORS) {
 | 
			
		||||
	const isCanvas2D = this && this.canvas && this.canvas.createImage
 | 
			
		||||
	return new Promise(async (resolve, reject) => {
 | 
			
		||||
		// let time = +new Date()
 | 
			
		||||
		let src = path.replace(/^@\//,'/')
 | 
			
		||||
		if (cache[path] && cache[path].errMsg) {
 | 
			
		||||
			resolve(cache[path])
 | 
			
		||||
		} else {
 | 
			
		||||
			try {
 | 
			
		||||
				// #ifdef MP || APP-PLUS
 | 
			
		||||
				if (isBase64(path) && (isCanvas2D ? isPC : true)) {
 | 
			
		||||
					src = await base64ToPath(path)
 | 
			
		||||
				}
 | 
			
		||||
				// #endif
 | 
			
		||||
				// #ifdef H5
 | 
			
		||||
				if(useCORS) {
 | 
			
		||||
					src = await pathToBase64(path)
 | 
			
		||||
				}
 | 
			
		||||
				// #endif
 | 
			
		||||
			} catch (error) {
 | 
			
		||||
				reject({
 | 
			
		||||
					...error,
 | 
			
		||||
					src
 | 
			
		||||
				})
 | 
			
		||||
			}
 | 
			
		||||
			// #ifndef APP-NVUE
 | 
			
		||||
			if(isCanvas2D && !isPC) {
 | 
			
		||||
				const img = this.canvas.createImage()
 | 
			
		||||
				img.onload = function() {
 | 
			
		||||
					const image = {
 | 
			
		||||
						path: img,
 | 
			
		||||
						width:  img.width,
 | 
			
		||||
						height:  img.height
 | 
			
		||||
					}
 | 
			
		||||
					cache[path] = image
 | 
			
		||||
					resolve(cache[path])
 | 
			
		||||
				}
 | 
			
		||||
				img.onerror = function(err) {
 | 
			
		||||
					reject({err,path})
 | 
			
		||||
				}
 | 
			
		||||
				img.src = src
 | 
			
		||||
				return
 | 
			
		||||
			}
 | 
			
		||||
			// #endif
 | 
			
		||||
			uni.getImageInfo({
 | 
			
		||||
				src,
 | 
			
		||||
				success: (image) => {
 | 
			
		||||
					const localReg = /^\.|^\/(?=[^\/])/;
 | 
			
		||||
					// #ifdef MP-WEIXIN || MP-BAIDU || MP-QQ || MP-TOUTIAO
 | 
			
		||||
					image.path = localReg.test(src) ?  `/${image.path}` : image.path;
 | 
			
		||||
					// #endif
 | 
			
		||||
					if(isCanvas2D) {
 | 
			
		||||
						const img = this.canvas.createImage()
 | 
			
		||||
						img.onload = function() {
 | 
			
		||||
							image.path = img
 | 
			
		||||
							cache[path] = image
 | 
			
		||||
							resolve(cache[path])
 | 
			
		||||
						}
 | 
			
		||||
						img.onerror = function(err) {
 | 
			
		||||
							reject({err,path})
 | 
			
		||||
						}
 | 
			
		||||
						img.src = src
 | 
			
		||||
						return
 | 
			
		||||
					}
 | 
			
		||||
					// #ifdef APP-PLUS
 | 
			
		||||
					// console.log('getImageInfo', +new Date() - time)
 | 
			
		||||
					// ios 比较严格 可能需要设置跨域
 | 
			
		||||
					if(uni.getSystemInfoSync().osName == 'ios' && useCORS) {
 | 
			
		||||
						pathToBase64(image.path).then(base64 => {
 | 
			
		||||
							image.path = base64
 | 
			
		||||
							cache[path] = image
 | 
			
		||||
							resolve(cache[path])
 | 
			
		||||
						}).catch(err => {
 | 
			
		||||
							console.error({err, path})
 | 
			
		||||
							reject({err,path})
 | 
			
		||||
						})
 | 
			
		||||
						return
 | 
			
		||||
					}
 | 
			
		||||
					// #endif
 | 
			
		||||
					cache[path] = image
 | 
			
		||||
					resolve(cache[path])
 | 
			
		||||
				},
 | 
			
		||||
				fail(err) {
 | 
			
		||||
					console.error({err, path})
 | 
			
		||||
					reject({err,path})
 | 
			
		||||
				}
 | 
			
		||||
			})
 | 
			
		||||
		}
 | 
			
		||||
	})
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// #ifdef APP-PLUS
 | 
			
		||||
const getLocalFilePath = (path) => {
 | 
			
		||||
	if (path.indexOf('_www') === 0 || path.indexOf('_doc') === 0 || path.indexOf('_documents') === 0 || path
 | 
			
		||||
		.indexOf('_downloads') === 0) {
 | 
			
		||||
		return path
 | 
			
		||||
	}
 | 
			
		||||
	if (path.indexOf('file://') === 0) {
 | 
			
		||||
		return path
 | 
			
		||||
	}
 | 
			
		||||
	if (path.indexOf('/storage/emulated/0/') === 0) {
 | 
			
		||||
		return path
 | 
			
		||||
	}
 | 
			
		||||
	if (path.indexOf('/') === 0) {
 | 
			
		||||
		const localFilePath = plus.io.convertAbsoluteFileSystem(path)
 | 
			
		||||
		if (localFilePath !== path) {
 | 
			
		||||
			return localFilePath
 | 
			
		||||
		} else {
 | 
			
		||||
			path = path.substr(1)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return '_www/' + path
 | 
			
		||||
}
 | 
			
		||||
// #endif
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										119
									
								
								uni_modules/lime-painter/hybrid/html/index.html
									
									
									
									
									
										Normal file
									
								
							
							
						
						@ -0,0 +1,119 @@
 | 
			
		||||
<!DOCTYPE html>
 | 
			
		||||
<html lang="zh">
 | 
			
		||||
 | 
			
		||||
<head>
 | 
			
		||||
	<meta charset="UTF-8">
 | 
			
		||||
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
 | 
			
		||||
	<meta http-equiv="X-UA-Compatible" content="ie=edge">
 | 
			
		||||
	<title></title>
 | 
			
		||||
	<style type="text/css">
 | 
			
		||||
		html,
 | 
			
		||||
		body,
 | 
			
		||||
		canvas {
 | 
			
		||||
			padding: 0;
 | 
			
		||||
			margin: 0;
 | 
			
		||||
			width: 100%;
 | 
			
		||||
			height: 100%;
 | 
			
		||||
			overflow-y: hidden;
 | 
			
		||||
			background-color: transparent;
 | 
			
		||||
		}
 | 
			
		||||
	</style>
 | 
			
		||||
</head>
 | 
			
		||||
 | 
			
		||||
<body>
 | 
			
		||||
	<canvas id="lime-painter"></canvas>
 | 
			
		||||
	<script type="text/javascript" src="./uni.webview.1.5.3.js"></script>
 | 
			
		||||
	<script type="text/javascript" src="./painter.js"></script>
 | 
			
		||||
	<script> 
 | 
			
		||||
		var cache = [];
 | 
			
		||||
		var painter = null;
 | 
			
		||||
		var canvas = null;
 | 
			
		||||
		var context = null;
 | 
			
		||||
		var timer = null;
 | 
			
		||||
		var pixelRatio = 1;
 | 
			
		||||
		console.log = function (...args) {
 | 
			
		||||
			postMessage(args);
 | 
			
		||||
		};
 | 
			
		||||
		// function stringify(key, value) {
 | 
			
		||||
		// 	if (typeof value === 'object' && value !== null) {
 | 
			
		||||
		// 		if (cache.indexOf(value) !== -1) {
 | 
			
		||||
		// 			return;
 | 
			
		||||
		// 		}
 | 
			
		||||
		// 		cache.push(value);
 | 
			
		||||
		// 	}
 | 
			
		||||
		// 	return value;
 | 
			
		||||
		// };
 | 
			
		||||
 | 
			
		||||
		function emit(event, data) {
 | 
			
		||||
			postMessage({
 | 
			
		||||
				event,
 | 
			
		||||
				data: (typeof data !== 'object' && data !== null ? data : JSON.stringify(data)) 
 | 
			
		||||
			});
 | 
			
		||||
			cache = [];
 | 
			
		||||
		};
 | 
			
		||||
		function postMessage(data) {
 | 
			
		||||
			uni.postMessage({
 | 
			
		||||
				data
 | 
			
		||||
			});
 | 
			
		||||
		};
 | 
			
		||||
		
 | 
			
		||||
		function init(dpr) {
 | 
			
		||||
			canvas = document.querySelector('#lime-painter');
 | 
			
		||||
			context = canvas.getContext('2d');
 | 
			
		||||
			pixelRatio = dpr || window.devicePixelRatio;
 | 
			
		||||
			painter = new Painter({
 | 
			
		||||
				id: 'lime-painter',
 | 
			
		||||
				context,
 | 
			
		||||
				canvas,
 | 
			
		||||
				pixelRatio,
 | 
			
		||||
				width: canvas.offsetWidth,
 | 
			
		||||
				height: canvas.offsetHeight,
 | 
			
		||||
				listen: {
 | 
			
		||||
					onProgress(v) {
 | 
			
		||||
						emit('progressChange', v);
 | 
			
		||||
					},
 | 
			
		||||
					onEffectFail(err) {
 | 
			
		||||
						//console.error(err)
 | 
			
		||||
						emit('fail', err);
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			});
 | 
			
		||||
			emit('inited', true);
 | 
			
		||||
		};
 | 
			
		||||
		function save(args) {
 | 
			
		||||
			delete args.success;
 | 
			
		||||
			delete args.fail;
 | 
			
		||||
			clearTimeout(timer);
 | 
			
		||||
			timer = setTimeout(() => {
 | 
			
		||||
				const path = painter.save(args);
 | 
			
		||||
				if (typeof path == 'string') {
 | 
			
		||||
					const index = Math.ceil(path.length / 8);
 | 
			
		||||
					for (var i = 0; i < 8; i++) {
 | 
			
		||||
						if (i == 7) {
 | 
			
		||||
							emit('success', path.substr(i * index, index));
 | 
			
		||||
						} else {
 | 
			
		||||
							emit('file', path.substr(i * index, index));
 | 
			
		||||
						}
 | 
			
		||||
					};
 | 
			
		||||
				} else {
 | 
			
		||||
					// console.log('canvas no data')
 | 
			
		||||
					emit('fail', 'canvas no data');
 | 
			
		||||
				};
 | 
			
		||||
			}, 30);
 | 
			
		||||
		};
 | 
			
		||||
		async function source(args) {
 | 
			
		||||
			let size = await painter.source(args);
 | 
			
		||||
			emit('layoutChange', size);
 | 
			
		||||
			if(!canvas.height) {
 | 
			
		||||
				console.log('canvas no size')
 | 
			
		||||
				emit('fail', 'canvas no size');
 | 
			
		||||
			}
 | 
			
		||||
			painter.render().catch(err => {
 | 
			
		||||
				// console.error(err)
 | 
			
		||||
				emit('fail', err);
 | 
			
		||||
			});
 | 
			
		||||
		};
 | 
			
		||||
	</script>
 | 
			
		||||
</body>
 | 
			
		||||
 | 
			
		||||
</html>
 | 
			
		||||
							
								
								
									
										1
									
								
								uni_modules/lime-painter/hybrid/html/painter.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
							
								
								
									
										93
									
								
								uni_modules/lime-painter/package.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						@ -0,0 +1,93 @@
 | 
			
		||||
{
 | 
			
		||||
  "id": "lime-painter",
 | 
			
		||||
  "displayName": "海报画板",
 | 
			
		||||
  "version": "1.9.6.5",
 | 
			
		||||
  "description": "一款canvas海报组件,更优雅的海报生成方案,有限的支持富文本",
 | 
			
		||||
  "keywords": [
 | 
			
		||||
    "海报",
 | 
			
		||||
    "富文本",
 | 
			
		||||
    "生成海报",
 | 
			
		||||
    "生成二维码",
 | 
			
		||||
    "JSON"
 | 
			
		||||
],
 | 
			
		||||
  "repository": "https://gitee.com/liangei/lime-painter", 
 | 
			
		||||
  "engines": {
 | 
			
		||||
    "HBuilderX": "^3.4.14"
 | 
			
		||||
  },
 | 
			
		||||
"dcloudext": {
 | 
			
		||||
    "sale": {
 | 
			
		||||
      "regular": {
 | 
			
		||||
        "price": "0.00"
 | 
			
		||||
      },
 | 
			
		||||
      "sourcecode": {
 | 
			
		||||
        "price": "0.00"
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    "contact": {
 | 
			
		||||
      "qq": "305716444"
 | 
			
		||||
    },
 | 
			
		||||
    "declaration": {
 | 
			
		||||
      "ads": "无",
 | 
			
		||||
      "data": "无",
 | 
			
		||||
      "permissions": "无"
 | 
			
		||||
    },
 | 
			
		||||
    "npmurl": "",
 | 
			
		||||
    "type": "component-vue"
 | 
			
		||||
  },
 | 
			
		||||
  "uni_modules": {
 | 
			
		||||
    "dependencies": [],
 | 
			
		||||
    "encrypt": [],
 | 
			
		||||
    "platforms": {
 | 
			
		||||
      "cloud": {
 | 
			
		||||
        "tcb": "y",
 | 
			
		||||
        "aliyun": "y",
 | 
			
		||||
        "alipay": "n"
 | 
			
		||||
      },
 | 
			
		||||
      "client": {
 | 
			
		||||
        "App": {
 | 
			
		||||
          "app-vue": "y",
 | 
			
		||||
          "app-nvue": "y"
 | 
			
		||||
        },
 | 
			
		||||
        "H5-mobile": {
 | 
			
		||||
          "Safari": "y",
 | 
			
		||||
          "Android Browser": "y",
 | 
			
		||||
          "微信浏览器(Android)": "y",
 | 
			
		||||
          "QQ浏览器(Android)": "y"
 | 
			
		||||
        },
 | 
			
		||||
        "H5-pc": {
 | 
			
		||||
          "Chrome": "y",
 | 
			
		||||
          "IE": "u",
 | 
			
		||||
          "Edge": "u",
 | 
			
		||||
          "Firefox": "u",
 | 
			
		||||
          "Safari": "y"
 | 
			
		||||
        },
 | 
			
		||||
        "小程序": {
 | 
			
		||||
          "微信": "y",
 | 
			
		||||
          "阿里": "y",
 | 
			
		||||
          "百度": "y",
 | 
			
		||||
          "字节跳动": "y",
 | 
			
		||||
        "QQ": "y",
 | 
			
		||||
        "钉钉": "u",
 | 
			
		||||
        "快手": "u",
 | 
			
		||||
        "飞书": "u",
 | 
			
		||||
        "京东": "u"
 | 
			
		||||
        },
 | 
			
		||||
        "快应用": {
 | 
			
		||||
          "华为": "u",
 | 
			
		||||
          "联盟": "u"
 | 
			
		||||
        },
 | 
			
		||||
        "Vue": {
 | 
			
		||||
            "vue2": "y",
 | 
			
		||||
            "vue3": "y"
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  },
 | 
			
		||||
  "name": "lime-painter",
 | 
			
		||||
  "main": "index.js",
 | 
			
		||||
  "scripts": {
 | 
			
		||||
    "test": "echo \"Error: no test specified\" && exit 1"
 | 
			
		||||
  },
 | 
			
		||||
  "author": "",
 | 
			
		||||
  "license": "ISC"
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										388
									
								
								uni_modules/lime-painter/parser.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						@ -0,0 +1,388 @@
 | 
			
		||||
/*
 | 
			
		||||
 * HTML5 Parser By Sam Blowes
 | 
			
		||||
 *
 | 
			
		||||
 * Designed for HTML5 documents
 | 
			
		||||
 *
 | 
			
		||||
 * Original code by John Resig (ejohn.org)
 | 
			
		||||
 * http://ejohn.org/blog/pure-javascript-html-parser/
 | 
			
		||||
 * Original code by Erik Arvidsson, Mozilla Public License
 | 
			
		||||
 * http://erik.eae.net/simplehtmlparser/simplehtmlparser.js
 | 
			
		||||
 *
 | 
			
		||||
 * ----------------------------------------------------------------------------
 | 
			
		||||
 * License
 | 
			
		||||
 * ----------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * This code is triple licensed using Apache Software License 2.0,
 | 
			
		||||
 * Mozilla Public License or GNU Public License
 | 
			
		||||
 *
 | 
			
		||||
 * ////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
 *
 | 
			
		||||
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 | 
			
		||||
 * use this file except in compliance with the License.  You may obtain a copy
 | 
			
		||||
 * of the License at http://www.apache.org/licenses/LICENSE-2.0
 | 
			
		||||
 *
 | 
			
		||||
 * ////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
 *
 | 
			
		||||
 * The contents of this file are subject to the Mozilla Public License
 | 
			
		||||
 * Version 1.1 (the "License"); you may not use this file except in
 | 
			
		||||
 * compliance with the License. You may obtain a copy of the License at
 | 
			
		||||
 * http://www.mozilla.org/MPL/
 | 
			
		||||
 *
 | 
			
		||||
 * Software distributed under the License is distributed on an "AS IS"
 | 
			
		||||
 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
 | 
			
		||||
 * License for the specific language governing rights and limitations
 | 
			
		||||
 * under the License.
 | 
			
		||||
 *
 | 
			
		||||
 * The Original Code is Simple HTML Parser.
 | 
			
		||||
 *
 | 
			
		||||
 * The Initial Developer of the Original Code is Erik Arvidsson.
 | 
			
		||||
 * Portions created by Erik Arvidssson are Copyright (C) 2004. All Rights
 | 
			
		||||
 * Reserved.
 | 
			
		||||
 *
 | 
			
		||||
 * ////////////////////////////////////////////////////////////////////////////
 | 
			
		||||
 *
 | 
			
		||||
 * This program is free software; you can redistribute it and/or
 | 
			
		||||
 * modify it under the terms of the GNU General Public License
 | 
			
		||||
 * as published by the Free Software Foundation; either version 2
 | 
			
		||||
 * of the License, or (at your option) any later version.
 | 
			
		||||
 *
 | 
			
		||||
 * This program is distributed in the hope that it will be useful,
 | 
			
		||||
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 | 
			
		||||
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 | 
			
		||||
 * GNU General Public License for more details.
 | 
			
		||||
 *
 | 
			
		||||
 * You should have received a copy of the GNU General Public License
 | 
			
		||||
 * along with this program; if not, write to the Free Software
 | 
			
		||||
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 | 
			
		||||
 *
 | 
			
		||||
 * ----------------------------------------------------------------------------
 | 
			
		||||
 * Usage
 | 
			
		||||
 * ----------------------------------------------------------------------------
 | 
			
		||||
 *
 | 
			
		||||
 * // Use like so:
 | 
			
		||||
 * HTMLParser(htmlString, {
 | 
			
		||||
 *     start: function(tag, attrs, unary) {},
 | 
			
		||||
 *     end: function(tag) {},
 | 
			
		||||
 *     chars: function(text) {},
 | 
			
		||||
 *     comment: function(text) {}
 | 
			
		||||
 * });
 | 
			
		||||
 *
 | 
			
		||||
 * // or to get an XML string:
 | 
			
		||||
 * HTMLtoXML(htmlString);
 | 
			
		||||
 *
 | 
			
		||||
 * // or to get an XML DOM Document
 | 
			
		||||
 * HTMLtoDOM(htmlString);
 | 
			
		||||
 *
 | 
			
		||||
 * // or to inject into an existing document/DOM node
 | 
			
		||||
 * HTMLtoDOM(htmlString, document);
 | 
			
		||||
 * HTMLtoDOM(htmlString, document.body);
 | 
			
		||||
 *
 | 
			
		||||
 */
 | 
			
		||||
// Regular Expressions for parsing tags and attributes
 | 
			
		||||
var startTag = /^<([-A-Za-z0-9_]+)((?:\s+[a-zA-Z_:][-a-zA-Z0-9_:.]*(?:\s*=\s*(?:(?:"[^"]*")|(?:'[^']*')|[^>\s]+))?)*)\s*(\/?)>/;
 | 
			
		||||
var endTag = /^<\/([-A-Za-z0-9_]+)[^>]*>/;
 | 
			
		||||
var attr = /([a-zA-Z_:][-a-zA-Z0-9_:.]*)(?:\s*=\s*(?:(?:"((?:\\.|[^"])*)")|(?:'((?:\\.|[^'])*)')|([^>\s]+)))?/g; // Empty Elements - HTML 5
 | 
			
		||||
 | 
			
		||||
var empty = makeMap('area,base,basefont,br,col,frame,hr,img,input,link,meta,param,embed,command,keygen,source,track,wbr'); // Block Elements - HTML 5
 | 
			
		||||
// fixed by xxx 将 ins 标签从块级名单中移除
 | 
			
		||||
 | 
			
		||||
var block = makeMap('a,address,article,applet,aside,audio,blockquote,button,canvas,center,dd,del,dir,div,dl,dt,fieldset,figcaption,figure,footer,form,frameset,h1,h2,h3,h4,h5,h6,header,hgroup,hr,iframe,isindex,li,map,menu,noframes,noscript,object,ol,output,p,pre,section,script,table,tbody,td,tfoot,th,thead,tr,ul,video'); // Inline Elements - HTML 5
 | 
			
		||||
 | 
			
		||||
var inline = makeMap('abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,em,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,span,strike,strong,sub,sup,textarea,tt,u,var'); // Elements that you can, intentionally, leave open
 | 
			
		||||
// (and which close themselves)
 | 
			
		||||
 | 
			
		||||
var closeSelf = makeMap('colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr'); // Attributes that have their values filled in disabled="disabled"
 | 
			
		||||
 | 
			
		||||
var fillAttrs = makeMap('checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected'); // Special Elements (can contain anything)
 | 
			
		||||
 | 
			
		||||
var special = makeMap('script,style');
 | 
			
		||||
function HTMLParser(html, handler) {
 | 
			
		||||
  var index;
 | 
			
		||||
  var chars;
 | 
			
		||||
  var match;
 | 
			
		||||
  var stack = [];
 | 
			
		||||
  var last = html;
 | 
			
		||||
 | 
			
		||||
  stack.last = function () {
 | 
			
		||||
    return this[this.length - 1];
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
  while (html) {
 | 
			
		||||
    chars = true; // Make sure we're not in a script or style element
 | 
			
		||||
 | 
			
		||||
    if (!stack.last() || !special[stack.last()]) {
 | 
			
		||||
      // Comment
 | 
			
		||||
      if (html.indexOf('<!--') == 0) {
 | 
			
		||||
        index = html.indexOf('-->');
 | 
			
		||||
 | 
			
		||||
        if (index >= 0) {
 | 
			
		||||
          if (handler.comment) {
 | 
			
		||||
            handler.comment(html.substring(4, index));
 | 
			
		||||
          }
 | 
			
		||||
 | 
			
		||||
          html = html.substring(index + 3);
 | 
			
		||||
          chars = false;
 | 
			
		||||
        } // end tag
 | 
			
		||||
 | 
			
		||||
      } else if (html.indexOf('</') == 0) {
 | 
			
		||||
        match = html.match(endTag);
 | 
			
		||||
 | 
			
		||||
        if (match) {
 | 
			
		||||
          html = html.substring(match[0].length);
 | 
			
		||||
          match[0].replace(endTag, parseEndTag);
 | 
			
		||||
          chars = false;
 | 
			
		||||
        } // start tag
 | 
			
		||||
 | 
			
		||||
      } else if (html.indexOf('<') == 0) {
 | 
			
		||||
        match = html.match(startTag);
 | 
			
		||||
 | 
			
		||||
        if (match) {
 | 
			
		||||
          html = html.substring(match[0].length);
 | 
			
		||||
          match[0].replace(startTag, parseStartTag);
 | 
			
		||||
          chars = false;
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      if (chars) {
 | 
			
		||||
        index = html.indexOf('<');
 | 
			
		||||
        var text = index < 0 ? html : html.substring(0, index);
 | 
			
		||||
        html = index < 0 ? '' : html.substring(index);
 | 
			
		||||
 | 
			
		||||
        if (handler.chars) {
 | 
			
		||||
          handler.chars(text);
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
    } else {
 | 
			
		||||
      html = html.replace(new RegExp('([\\s\\S]*?)<\/' + stack.last() + '[^>]*>'), function (all, text) {
 | 
			
		||||
        text = text.replace(/<!--([\s\S]*?)-->|<!\[CDATA\[([\s\S]*?)]]>/g, '$1$2');
 | 
			
		||||
 | 
			
		||||
        if (handler.chars) {
 | 
			
		||||
          handler.chars(text);
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        return '';
 | 
			
		||||
      });
 | 
			
		||||
      parseEndTag('', stack.last());
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (html == last) {
 | 
			
		||||
      throw 'Parse Error: ' + html;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    last = html;
 | 
			
		||||
  } // Clean up any remaining tags
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  parseEndTag();
 | 
			
		||||
 | 
			
		||||
  function parseStartTag(tag, tagName, rest, unary) {
 | 
			
		||||
    tagName = tagName.toLowerCase();
 | 
			
		||||
    if (block[tagName]) {
 | 
			
		||||
      while (stack.last() && inline[stack.last()]) {
 | 
			
		||||
        parseEndTag('', stack.last());
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (closeSelf[tagName] && stack.last() == tagName) {
 | 
			
		||||
      parseEndTag('', tagName);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    unary = empty[tagName] || !!unary;
 | 
			
		||||
 | 
			
		||||
    if (!unary) {
 | 
			
		||||
      stack.push(tagName);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (handler.start) {
 | 
			
		||||
      var attrs = [];
 | 
			
		||||
      rest.replace(attr, function (match, name) {
 | 
			
		||||
        var value = arguments[2] ? arguments[2] : arguments[3] ? arguments[3] : arguments[4] ? arguments[4] : fillAttrs[name] ? name : '';
 | 
			
		||||
        attrs.push({
 | 
			
		||||
          name: name,
 | 
			
		||||
          value: value,
 | 
			
		||||
          escaped: value.replace(/(^|[^\\])"/g, '$1\\\"') // "
 | 
			
		||||
 | 
			
		||||
        });
 | 
			
		||||
      });
 | 
			
		||||
 | 
			
		||||
      if (handler.start) {
 | 
			
		||||
        handler.start(tagName, attrs, unary);
 | 
			
		||||
      }
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  function parseEndTag(tag, tagName) {
 | 
			
		||||
    // If no tag name is provided, clean shop
 | 
			
		||||
    if (!tagName) {
 | 
			
		||||
      var pos = 0;
 | 
			
		||||
    } // Find the closest opened tag of the same type
 | 
			
		||||
    else {
 | 
			
		||||
        for (var pos = stack.length - 1; pos >= 0; pos--) {
 | 
			
		||||
          if (stack[pos] == tagName) {
 | 
			
		||||
            break;
 | 
			
		||||
          }
 | 
			
		||||
        }
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
    if (pos >= 0) {
 | 
			
		||||
      // Close all the open elements, up the stack
 | 
			
		||||
      for (var i = stack.length - 1; i >= pos; i--) {
 | 
			
		||||
        if (handler.end) {
 | 
			
		||||
          handler.end(stack[i]);
 | 
			
		||||
        }
 | 
			
		||||
      } // Remove the open elements from the stack
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
      stack.length = pos;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function makeMap(str) {
 | 
			
		||||
  var obj = {};
 | 
			
		||||
  var items = str.split(',');
 | 
			
		||||
 | 
			
		||||
  for (var i = 0; i < items.length; i++) {
 | 
			
		||||
    obj[items[i]] = true;
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  return obj;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function removeDOCTYPE(html) {
 | 
			
		||||
  return html.replace(/<\?xml.*\?>\n/, '').replace(/<!doctype.*>\n/, '').replace(/<!DOCTYPE.*>\n/, '');
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function parseAttrs(attrs) {
 | 
			
		||||
  return attrs.reduce(function (pre, attr) {
 | 
			
		||||
    var value = attr.value;
 | 
			
		||||
    var name = attr.name;
 | 
			
		||||
    if (pre[name]) {
 | 
			
		||||
			pre[name] = pre[name] + " " + value;
 | 
			
		||||
    } else {
 | 
			
		||||
			pre[name] = value;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    return pre;
 | 
			
		||||
  }, {});
 | 
			
		||||
}
 | 
			
		||||
function convertStyleStringToJSON(styleString) {
 | 
			
		||||
  var styles = styleString.split(";"); // 通过分号将样式字符串分割为多个样式声明
 | 
			
		||||
  var result = {};
 | 
			
		||||
 | 
			
		||||
  styles.forEach(function(style) {
 | 
			
		||||
    var styleParts = style.split(":"); // 通过冒号将样式声明分割为属性和值
 | 
			
		||||
    var property = styleParts[0].trim();
 | 
			
		||||
    var value = styleParts[1] && styleParts[1].trim();
 | 
			
		||||
 | 
			
		||||
    if (property && value) {
 | 
			
		||||
      result[property] = value; // 将属性和值添加到结果对象中
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  return result;
 | 
			
		||||
}
 | 
			
		||||
function parseHtml(html) {
 | 
			
		||||
  html = removeDOCTYPE(html);
 | 
			
		||||
  var stacks = [];
 | 
			
		||||
  var results = {
 | 
			
		||||
    node: 'root',
 | 
			
		||||
    children: []
 | 
			
		||||
  };
 | 
			
		||||
  HTMLParser(html, {
 | 
			
		||||
    start: function start(tag, attrs, unary) {
 | 
			
		||||
      var node = {
 | 
			
		||||
        name: tag
 | 
			
		||||
      };
 | 
			
		||||
 | 
			
		||||
      if (attrs.length !== 0) {
 | 
			
		||||
        node.attrs = parseAttrs(attrs);
 | 
			
		||||
		node.styles = node.attrs.style ? convertStyleStringToJSON(node.attrs.style) : {}
 | 
			
		||||
      }
 | 
			
		||||
	
 | 
			
		||||
	if(!node.type) {
 | 
			
		||||
	  if(inline[node.name] && node.name !== 'img' ) {
 | 
			
		||||
		node.type = 'text';
 | 
			
		||||
		if(node.name == 'br') {
 | 
			
		||||
			node.text = '\n'
 | 
			
		||||
		} else if(node.name == 'strong'){
 | 
			
		||||
			node.styles.fontWeight = 'bold'
 | 
			
		||||
		}
 | 
			
		||||
	  } else if(node.name == 'img'){
 | 
			
		||||
		 node.type = 'image' 
 | 
			
		||||
		 node.src =  node.attrs.src
 | 
			
		||||
	  } else {
 | 
			
		||||
		   node.type = 'view' 
 | 
			
		||||
		   if(['h1','h2','h3','h4','h5','h6'].includes(node.name)) {
 | 
			
		||||
			   node.styles.fontWeight = 'bold'
 | 
			
		||||
		   }
 | 
			
		||||
	  }
 | 
			
		||||
	}		
 | 
			
		||||
      if (unary) {
 | 
			
		||||
        var parent = stacks[0] || results;
 | 
			
		||||
 | 
			
		||||
        if (!parent.children) {
 | 
			
		||||
          parent.children = [];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        parent.children.push(node);
 | 
			
		||||
      } else {
 | 
			
		||||
        stacks.unshift(node);
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    end: function end(tag) {
 | 
			
		||||
      var node = stacks.shift();
 | 
			
		||||
      if (node.name !== tag) console.error('invalid state: mismatch end tag');
 | 
			
		||||
      if (stacks.length === 0) {
 | 
			
		||||
        results.children.push(node);
 | 
			
		||||
      } else {
 | 
			
		||||
        var parent = stacks[0];
 | 
			
		||||
 | 
			
		||||
        if (!parent.children) {
 | 
			
		||||
          parent.children = [];
 | 
			
		||||
        }
 | 
			
		||||
        parent.children.push(node);
 | 
			
		||||
      }
 | 
			
		||||
	  const isTextBox = node.children && node.children.length > 1 && node.children.every(child => {
 | 
			
		||||
		  return ['text','image'].includes(child.type)
 | 
			
		||||
	  })
 | 
			
		||||
	  if(isTextBox) {
 | 
			
		||||
		  node.type = 'textBox'
 | 
			
		||||
	  }
 | 
			
		||||
    },
 | 
			
		||||
    chars: function chars(text) {
 | 
			
		||||
      var node = {
 | 
			
		||||
        type: 'text',
 | 
			
		||||
        text: text
 | 
			
		||||
      };
 | 
			
		||||
 | 
			
		||||
      if (stacks.length === 0) {
 | 
			
		||||
        results.children.push(node);
 | 
			
		||||
      } else {
 | 
			
		||||
        var parent = stacks[0];
 | 
			
		||||
 | 
			
		||||
        if (!parent.children) {
 | 
			
		||||
          parent.children = [];
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        parent.children.push(node);
 | 
			
		||||
      }
 | 
			
		||||
    },
 | 
			
		||||
    comment: function comment(text) {
 | 
			
		||||
      var node = {
 | 
			
		||||
        node: 'comment',
 | 
			
		||||
        text: text
 | 
			
		||||
      };
 | 
			
		||||
      var parent = stacks[0];
 | 
			
		||||
 | 
			
		||||
      if (!parent.children) {
 | 
			
		||||
        parent.children = [];
 | 
			
		||||
      }
 | 
			
		||||
 | 
			
		||||
      parent.children.push(node);
 | 
			
		||||
    }
 | 
			
		||||
  });
 | 
			
		||||
  return results.children;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export default parseHtml;
 | 
			
		||||
							
								
								
									
										963
									
								
								uni_modules/lime-painter/readme.md
									
									
									
									
									
										Normal file
									
								
							
							
						
						@ -0,0 +1,963 @@
 | 
			
		||||
# Painter 画板 测试版
 | 
			
		||||
 | 
			
		||||
> uniapp 海报画板,更优雅的海报生成方案  
 | 
			
		||||
> [查看更多 站点 1](https://limeui.qcoon.cn/#/painter)  
 | 
			
		||||
> [查看更多 站点 2](http://liangei.gitee.io/limeui/#/painter)  
 | 
			
		||||
> Q 群:1169785031
 | 
			
		||||
 | 
			
		||||
## 平台兼容
 | 
			
		||||
 | 
			
		||||
| H5  | 微信小程序 | 支付宝小程序 | 百度小程序 | 头条小程序 | QQ 小程序 | App |
 | 
			
		||||
| --- | ---------- | ------------ | ---------- | ---------- | --------- | --- |
 | 
			
		||||
| √   | √          | √            | 未测       | √          | √         | √   |
 | 
			
		||||
 | 
			
		||||
## 安装
 | 
			
		||||
在市场导入**[海报画板](https://ext.dcloud.net.cn/plugin?id=2389)uni_modules**版本的即可,无需`import`
 | 
			
		||||
 | 
			
		||||
## 代码演示
 | 
			
		||||
 | 
			
		||||
### 插件demo
 | 
			
		||||
- lime-painter 为 demo
 | 
			
		||||
- 位于 uni_modules/lime-painter/components/lime-painter
 | 
			
		||||
- 导入插件后直接使用可查看demo
 | 
			
		||||
```vue
 | 
			
		||||
<lime-painter />
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### 基本用法
 | 
			
		||||
 | 
			
		||||
- 插件提供 JSON 及 Template 的方式绘制海报
 | 
			
		||||
- 参考 css 块状流布局模拟 css schema。
 | 
			
		||||
- 另外flex布局还不是成完善,请谨慎使用,普通的流布局我觉得已经够用了。
 | 
			
		||||
 | 
			
		||||
#### 方式一 Template
 | 
			
		||||
 | 
			
		||||
- 提供`l-painter-view`、`l-painter-text`、`l-painter-image`、`l-painter-qrcode`四种类型组件
 | 
			
		||||
- 通过 `css` 属性绘制样式,与 style 使用方式保持一致。
 | 
			
		||||
```html
 | 
			
		||||
<l-painter>
 | 
			
		||||
	//如果使用Template出现顺序错乱,可使用`template` 等所有变量完成再显示
 | 
			
		||||
	<template v-if="show">
 | 
			
		||||
		<l-painter-view
 | 
			
		||||
			css="background: #07c160; height: 120rpx; width: 120rpx; display: inline-block"
 | 
			
		||||
		></l-painter-view>
 | 
			
		||||
		<l-painter-view
 | 
			
		||||
			css="background: #1989fa; height: 120rpx; width: 120rpx; border-top-right-radius: 60rpx; border-bottom-left-radius: 60rpx; display: inline-block; margin: 0 30rpx;"
 | 
			
		||||
		></l-painter-view>
 | 
			
		||||
		<l-painter-view
 | 
			
		||||
			css="background: #ff9d00; height: 120rpx; width: 120rpx; border-radius: 50%; display: inline-block"
 | 
			
		||||
		></l-painter-view>
 | 
			
		||||
	<template>
 | 
			
		||||
</l-painter>
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
#### 方式二 JSON
 | 
			
		||||
 | 
			
		||||
- 在 json 里四种类型组件的`type`为`view`、`text`、`image`、`qrcode`
 | 
			
		||||
- 通过 `board` 设置海报所需的 JSON 数据进行绘制或`ref`获取组件实例调用组件内的`render(json)`
 | 
			
		||||
- 所有类型的 schema 都具有`css`字段,css 的 key 值使用**驼峰**如:`lineHeight`
 | 
			
		||||
 | 
			
		||||
```html
 | 
			
		||||
<l-painter :board="poster"/>
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
```js
 | 
			
		||||
data() {
 | 
			
		||||
	return {
 | 
			
		||||
		poster: {
 | 
			
		||||
			css: {
 | 
			
		||||
				// 根节点若无尺寸,自动获取父级节点
 | 
			
		||||
				width: '750rpx'
 | 
			
		||||
			},
 | 
			
		||||
			views: [
 | 
			
		||||
				{
 | 
			
		||||
					css: {
 | 
			
		||||
						background: "#07c160",
 | 
			
		||||
						height: "120rpx",
 | 
			
		||||
						width: "120rpx",
 | 
			
		||||
						display: "inline-block"
 | 
			
		||||
					},
 | 
			
		||||
					type: "view"
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					css: {
 | 
			
		||||
						background: "#1989fa",
 | 
			
		||||
						height: "120rpx",
 | 
			
		||||
						width: "120rpx",
 | 
			
		||||
						borderTopRightRadius: "60rpx",
 | 
			
		||||
						borderBottomLeftRadius: "60rpx",
 | 
			
		||||
						display: "inline-block",
 | 
			
		||||
						margin: "0 30rpx"
 | 
			
		||||
					},
 | 
			
		||||
					views: [],
 | 
			
		||||
					type: "view"
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					css: {
 | 
			
		||||
						background: "#ff9d00",
 | 
			
		||||
						height: "120rpx",
 | 
			
		||||
						width: "120rpx",
 | 
			
		||||
						borderRadius: "50%",
 | 
			
		||||
						display: "inline-block"
 | 
			
		||||
					},
 | 
			
		||||
					views: [],
 | 
			
		||||
					type: "view"
 | 
			
		||||
				},
 | 
			
		||||
			]
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### View 容器
 | 
			
		||||
 | 
			
		||||
- 类似于 `div` 可以嵌套承载更多的 view、text、image,qrcode 共同构建一颗完整的节点树
 | 
			
		||||
- 在 JSON 里具有 `views` 的数组字段,用于嵌套承载节点。
 | 
			
		||||
 | 
			
		||||
#### 方式一 Template
 | 
			
		||||
 | 
			
		||||
```html
 | 
			
		||||
<l-painter>
 | 
			
		||||
  <l-painter-view css="background: #f0f0f0; padding-top: 100rpx;">
 | 
			
		||||
    <l-painter-view
 | 
			
		||||
      css="background: #d9d9d9; width: 33.33%; height: 100rpx; display: inline-block"
 | 
			
		||||
    ></l-painter-view>
 | 
			
		||||
    <l-painter-view
 | 
			
		||||
      css="background: #bfbfbf; width: 66.66%; height: 100rpx; display: inline-block"
 | 
			
		||||
    ></l-painter-view>
 | 
			
		||||
  </l-painter-view>
 | 
			
		||||
</l-painter>
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
#### 方式二 JSON
 | 
			
		||||
 | 
			
		||||
```js
 | 
			
		||||
{
 | 
			
		||||
	css: {},
 | 
			
		||||
	views: [
 | 
			
		||||
		{
 | 
			
		||||
			type: 'view',
 | 
			
		||||
			css: {
 | 
			
		||||
				background: '#f0f0f0',
 | 
			
		||||
				paddingTop: '100rpx'
 | 
			
		||||
			},
 | 
			
		||||
			views: [
 | 
			
		||||
				{
 | 
			
		||||
					type: 'view',
 | 
			
		||||
					css: {
 | 
			
		||||
						background: '#d9d9d9',
 | 
			
		||||
						width: '33.33%',
 | 
			
		||||
						height: '100rpx',
 | 
			
		||||
						display: 'inline-block'
 | 
			
		||||
					}
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					type: 'view',
 | 
			
		||||
					css: {
 | 
			
		||||
						background: '#bfbfbf',
 | 
			
		||||
						width: '66.66%',
 | 
			
		||||
						height: '100rpx',
 | 
			
		||||
						display: 'inline-block'
 | 
			
		||||
					}
 | 
			
		||||
				}
 | 
			
		||||
			],
 | 
			
		||||
 | 
			
		||||
		}
 | 
			
		||||
	]
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### Text 文本
 | 
			
		||||
 | 
			
		||||
- 通过 `text` 属性填写文本内容。
 | 
			
		||||
- 支持`\n`换行符
 | 
			
		||||
- 支持省略号,使用 css 的`line-clamp`设置行数,当文字内容超过会显示省略号。
 | 
			
		||||
- 支持`text-decoration`
 | 
			
		||||
 | 
			
		||||
#### 方式一 Template
 | 
			
		||||
 | 
			
		||||
```html
 | 
			
		||||
<l-painter>
 | 
			
		||||
  <l-painter-view css="background: #e0e2db; padding: 30rpx; color: #222a29">
 | 
			
		||||
    <l-painter-text
 | 
			
		||||
      text="登鹳雀楼\n白日依山尽,黄河入海流\n欲穷千里目,更上一层楼"
 | 
			
		||||
    />
 | 
			
		||||
    <l-painter-text
 | 
			
		||||
      text="登鹳雀楼\n白日依山尽,黄河入海流\n欲穷千里目,更上一层楼"
 | 
			
		||||
      css="text-align:center; padding-top: 20rpx; text-decoration: line-through "
 | 
			
		||||
    />
 | 
			
		||||
    <l-painter-text
 | 
			
		||||
      text="登鹳雀楼\n白日依山尽,黄河入海流\n欲穷千里目,更上一层楼"
 | 
			
		||||
      css="text-align:right; padding-top: 20rpx"
 | 
			
		||||
    />
 | 
			
		||||
    <l-painter-text
 | 
			
		||||
      text="水调歌头\n明月几时有?把酒问青天。不知天上宫阙,今夕是何年。我欲乘风归去,又恐琼楼玉宇,高处不胜寒。起舞弄清影,何似在人间。"
 | 
			
		||||
      css="line-clamp: 3; padding-top: 20rpx; background: linear-gradient(,#ff971b 0%, #ff5000 100%); background-clip: text"
 | 
			
		||||
    />
 | 
			
		||||
  </l-painter-view>
 | 
			
		||||
</l-painter>
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
#### 方式二 JSON
 | 
			
		||||
 | 
			
		||||
```js
 | 
			
		||||
// 基础用法
 | 
			
		||||
{
 | 
			
		||||
	type: 'text',
 | 
			
		||||
	text: '登鹳雀楼\n白日依山尽,黄河入海流\n欲穷千里目,更上一层楼',
 | 
			
		||||
},
 | 
			
		||||
{
 | 
			
		||||
	type: 'text',
 | 
			
		||||
	text: '登鹳雀楼\n白日依山尽,黄河入海流\n欲穷千里目,更上一层楼',
 | 
			
		||||
	css: {
 | 
			
		||||
		// 设置居中对齐
 | 
			
		||||
		textAlign: 'center',
 | 
			
		||||
		// 设置中划线
 | 
			
		||||
		textDecoration: 'line-through'
 | 
			
		||||
	}
 | 
			
		||||
},
 | 
			
		||||
{
 | 
			
		||||
	type: 'text',
 | 
			
		||||
	text: '登鹳雀楼\n白日依山尽,黄河入海流\n欲穷千里目,更上一层楼',
 | 
			
		||||
	css: {
 | 
			
		||||
		// 设置右对齐
 | 
			
		||||
		textAlign: 'right',
 | 
			
		||||
	}
 | 
			
		||||
},
 | 
			
		||||
{
 | 
			
		||||
	type: 'text',
 | 
			
		||||
	text: '登鹳雀楼\n白日依山尽,黄河入海流\n欲穷千里目,更上一层楼',
 | 
			
		||||
	css: {
 | 
			
		||||
		// 设置行数,超出显示省略号
 | 
			
		||||
		lineClamp: 3,
 | 
			
		||||
		// 渐变文字
 | 
			
		||||
		background: 'linear-gradient(,#ff971b 0%, #1989fa 100%)',
 | 
			
		||||
		backgroundClip: 'text'
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### Image 图片
 | 
			
		||||
 | 
			
		||||
- 通过 `src` 属性填写图片路径。
 | 
			
		||||
- 图片路径支持:网络图片,本地 static 里的图片路径,缓存路径,**字节的static目录是写相对路径**
 | 
			
		||||
- 通过 `css` 的 `object-fit`属性可以设置图片的填充方式,可选值见下方 CSS 表格。
 | 
			
		||||
- 通过 `css` 的 `object-position`配合 `object-fit` 可以设置图片的对齐方式,类似于`background-position`,详情见下方 CSS 表格。
 | 
			
		||||
- 使用网络图片时:小程序需要去公众平台配置 [downloadFile](https://mp.weixin.qq.com/) 域名
 | 
			
		||||
- 使用网络图片时:**H5 和 Nvue 需要决跨域问题**
 | 
			
		||||
 | 
			
		||||
#### 方式一 Template
 | 
			
		||||
 | 
			
		||||
```html
 | 
			
		||||
<l-painter>
 | 
			
		||||
  <!-- 基础用法 -->
 | 
			
		||||
  <l-painter-image
 | 
			
		||||
    src="https://m.360buyimg.com/babel/jfs/t1/196317/32/13733/288158/60f4ea39E6fb378ed/d69205b1a8ed3c97.jpg"
 | 
			
		||||
    css="width: 200rpx; height: 200rpx"
 | 
			
		||||
  />
 | 
			
		||||
  <!-- 填充方式 -->
 | 
			
		||||
  <!-- css object-fit 设置 填充方式 见下方表格-->
 | 
			
		||||
  <l-painter-image
 | 
			
		||||
    src="https://m.360buyimg.com/babel/jfs/t1/196317/32/13733/288158/60f4ea39E6fb378ed/d69205b1a8ed3c97.jpg"
 | 
			
		||||
    css="width: 200rpx; height: 200rpx; object-fit: contain; background: #eee"
 | 
			
		||||
  />
 | 
			
		||||
  <!-- css object-position 设置 图片的对齐方式-->
 | 
			
		||||
  <l-painter-image
 | 
			
		||||
    src="https://m.360buyimg.com/babel/jfs/t1/196317/32/13733/288158/60f4ea39E6fb378ed/d69205b1a8ed3c97.jpg"
 | 
			
		||||
    css="width: 200rpx; height: 200rpx; object-fit: contain; object-position: 50% 50%; background: #eee"
 | 
			
		||||
  />
 | 
			
		||||
</l-painter>
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
#### 方式二 JSON
 | 
			
		||||
 | 
			
		||||
```js
 | 
			
		||||
// 基础用法
 | 
			
		||||
{
 | 
			
		||||
	type: 'image',
 | 
			
		||||
	src: 'https://m.360buyimg.com/babel/jfs/t1/196317/32/13733/288158/60f4ea39E6fb378ed/d69205b1a8ed3c97.jpg',
 | 
			
		||||
	css: {
 | 
			
		||||
		width: '200rpx',
 | 
			
		||||
		height: '200rpx'
 | 
			
		||||
	}
 | 
			
		||||
},
 | 
			
		||||
// 填充方式
 | 
			
		||||
// css objectFit 设置 填充方式 见下方表格
 | 
			
		||||
{
 | 
			
		||||
	type: 'image',
 | 
			
		||||
	src: 'https://m.360buyimg.com/babel/jfs/t1/196317/32/13733/288158/60f4ea39E6fb378ed/d69205b1a8ed3c97.jpg',
 | 
			
		||||
	css: {
 | 
			
		||||
		width: '200rpx',
 | 
			
		||||
		height: '200rpx',
 | 
			
		||||
		objectFit: 'contain'
 | 
			
		||||
	}
 | 
			
		||||
},
 | 
			
		||||
// css objectPosition 设置 图片的对齐方式
 | 
			
		||||
{
 | 
			
		||||
	type: 'image',
 | 
			
		||||
	src: 'https://m.360buyimg.com/babel/jfs/t1/196317/32/13733/288158/60f4ea39E6fb378ed/d69205b1a8ed3c97.jpg',
 | 
			
		||||
	css: {
 | 
			
		||||
		width: '200rpx',
 | 
			
		||||
		height: '200rpx',
 | 
			
		||||
		objectFit: 'contain',
 | 
			
		||||
		objectPosition: '50% 50%'
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### Qrcode 二维码
 | 
			
		||||
 | 
			
		||||
- 通过`text`属性填写需要生成二维码的文本。
 | 
			
		||||
- 通过 `css` 里的 `color` 可设置生成码点的颜色。
 | 
			
		||||
- 通过 `css` 里的 `background`可设置背景色。
 | 
			
		||||
- 通过 `css `里的 `width`、`height`设置尺寸。
 | 
			
		||||
 | 
			
		||||
#### 方式一 Template
 | 
			
		||||
 | 
			
		||||
```html
 | 
			
		||||
<l-painter>
 | 
			
		||||
  <l-painter-qrcode
 | 
			
		||||
    text="limeui.qcoon.cn"
 | 
			
		||||
    css="width: 200rpx; height: 200rpx"
 | 
			
		||||
  />
 | 
			
		||||
</l-painter>
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
#### 方式二 JSON
 | 
			
		||||
 | 
			
		||||
```js
 | 
			
		||||
{
 | 
			
		||||
	type: 'qrcode',
 | 
			
		||||
	text: 'limeui.qcoon.cn',
 | 
			
		||||
	css: {
 | 
			
		||||
		width: '200rpx',
 | 
			
		||||
		height: '200rpx',
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### 富文本
 | 
			
		||||
- 这是一个有限支持的测试能力,只能通过JSON方式,不要抱太大希望!
 | 
			
		||||
- 首先需要把富文本转成JSON,这需要引入`parser`这个包,如果你不使用是不会进入主包
 | 
			
		||||
 | 
			
		||||
```html
 | 
			
		||||
<l-painter ref="painter"/>
 | 
			
		||||
```
 | 
			
		||||
```js
 | 
			
		||||
import parseHtml from '@/uni_modules/lime-painter/parser'
 | 
			
		||||
const json = parseHtml(`<p><span>测试测试</span><img src="/static/logo.png"/></p>`)
 | 
			
		||||
this.$refs.painter.render(json)
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### 生成图片
 | 
			
		||||
 | 
			
		||||
- 方式1、通过设置`isCanvasToTempFilePath`自动生成图片并在 `@success` 事件里接收海报临时路径
 | 
			
		||||
- 方式2、通过调用内部方法生成图片:
 | 
			
		||||
 | 
			
		||||
```html
 | 
			
		||||
<l-painter ref="painter">...code</l-painter>
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
```js
 | 
			
		||||
this.$refs.painter.canvasToTempFilePathSync({
 | 
			
		||||
  fileType: "jpg",
 | 
			
		||||
  // 如果返回的是base64是无法使用 saveImageToPhotosAlbum,需要设置 pathType为url
 | 
			
		||||
  pathType: 'url',
 | 
			
		||||
  quality: 1,
 | 
			
		||||
  success: (res) => {
 | 
			
		||||
    console.log(res.tempFilePath);
 | 
			
		||||
	// 非H5 保存到相册
 | 
			
		||||
	// H5 提示用户长按图另存
 | 
			
		||||
	uni.saveImageToPhotosAlbum({
 | 
			
		||||
		filePath: res.tempFilePath,
 | 
			
		||||
		success: function () {
 | 
			
		||||
			console.log('save success');
 | 
			
		||||
		}
 | 
			
		||||
	});
 | 
			
		||||
  },
 | 
			
		||||
});
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### 主动调用方式
 | 
			
		||||
 | 
			
		||||
- 通过获取组件实例内部的`render`函数 传递`JSON`即可
 | 
			
		||||
 | 
			
		||||
```html
 | 
			
		||||
<l-painter ref="painter" />
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
```js
 | 
			
		||||
// 渲染
 | 
			
		||||
this.$refs.painter.render(jsonSchema);
 | 
			
		||||
// 生成图片
 | 
			
		||||
this.$refs.painter.canvasToTempFilePathSync({
 | 
			
		||||
  fileType: "jpg",
 | 
			
		||||
  // 如果返回的是base64是无法使用 saveImageToPhotosAlbum,需要设置 pathType为url
 | 
			
		||||
  pathType: 'url',
 | 
			
		||||
  quality: 1,
 | 
			
		||||
  success: (res) => {
 | 
			
		||||
    console.log(res.tempFilePath);
 | 
			
		||||
	// 非H5 保存到相册
 | 
			
		||||
	uni.saveImageToPhotosAlbum({
 | 
			
		||||
		filePath: res.tempFilePath,
 | 
			
		||||
		success: function () {
 | 
			
		||||
			console.log('save success');
 | 
			
		||||
		}
 | 
			
		||||
	});
 | 
			
		||||
  },
 | 
			
		||||
});
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### H5跨域
 | 
			
		||||
- 一般是需要后端或管理OSS资源的大佬处理
 | 
			
		||||
- 一般OSS的处理方式:
 | 
			
		||||
 | 
			
		||||
1、设置来源
 | 
			
		||||
```cmd
 | 
			
		||||
*
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
2、允许Methods
 | 
			
		||||
```html
 | 
			
		||||
GET
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
3、允许Headers
 | 
			
		||||
```html
 | 
			
		||||
access-control-allow-origin:*
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
4、最后如果还是不行,可试下给插件设置`useCORS`
 | 
			
		||||
```html
 | 
			
		||||
<l-painter useCORS>
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### 海报示例
 | 
			
		||||
 | 
			
		||||
- 提供一份示例,只把插件当成生成图片的工具,非必要不要在弹窗里使用。
 | 
			
		||||
- 通过设置`isCanvasToTempFilePath`主动生成图片,再由 `@success` 事件接收海报临时路径
 | 
			
		||||
- 设置`hidden`隐藏画板。
 | 
			
		||||
请注意,示例用到了图片,海报的渲染是包括下载图片的时间,也许在某天图片会失效或访问超级慢,请更换为你的图片再查看,另外如果你是小程序请在使用示例时把**不校验合法域名**勾上!!!!!不然不显示还以为是插件的锅,求求了大佬们!
 | 
			
		||||
#### 方式一 Template
 | 
			
		||||
 | 
			
		||||
```html
 | 
			
		||||
<image :src="path" mode="widthFix"></image>
 | 
			
		||||
<l-painter
 | 
			
		||||
  isCanvasToTempFilePath
 | 
			
		||||
  @success="path = $event"
 | 
			
		||||
  hidden
 | 
			
		||||
  css="width: 750rpx; padding-bottom: 40rpx; background: linear-gradient(,#ff971b 0%, #ff5000 100%)"
 | 
			
		||||
>
 | 
			
		||||
  <l-painter-image
 | 
			
		||||
    src="https://m.360buyimg.com/babel/jfs/t1/196317/32/13733/288158/60f4ea39E6fb378ed/d69205b1a8ed3c97.jpg"
 | 
			
		||||
    css="margin-left: 40rpx; margin-top: 40rpx; width: 84rpx;  height: 84rpx; border-radius: 50%;"
 | 
			
		||||
  />
 | 
			
		||||
  <l-painter-view
 | 
			
		||||
    css="margin-top: 40rpx; padding-left: 20rpx; display: inline-block"
 | 
			
		||||
  >
 | 
			
		||||
    <l-painter-text
 | 
			
		||||
      text="隔壁老王"
 | 
			
		||||
      css="display: block; padding-bottom: 10rpx; color: #fff; font-size: 32rpx; fontWeight: bold"
 | 
			
		||||
    />
 | 
			
		||||
    <l-painter-text
 | 
			
		||||
      text="为您挑选了一个好物"
 | 
			
		||||
      css="color: rgba(255,255,255,.7); font-size: 24rpx"
 | 
			
		||||
    />
 | 
			
		||||
  </l-painter-view>
 | 
			
		||||
  <l-painter-view
 | 
			
		||||
    css="margin-left: 40rpx; margin-top: 30rpx; padding: 32rpx; box-sizing: border-box; background: #fff; border-radius: 16rpx; width: 670rpx; box-shadow: 0 20rpx 58rpx rgba(0,0,0,.15)"
 | 
			
		||||
  >
 | 
			
		||||
    <l-painter-image
 | 
			
		||||
      src="https://m.360buyimg.com/babel/jfs/t1/196317/32/13733/288158/60f4ea39E6fb378ed/d69205b1a8ed3c97.jpg"
 | 
			
		||||
      css="object-fit: cover; object-position: 50% 50%; width: 606rpx; height: 606rpx; border-radius: 12rpx;"
 | 
			
		||||
    />
 | 
			
		||||
    <l-painter-view
 | 
			
		||||
      css="margin-top: 32rpx; color: #FF0000; font-weight: bold; font-size: 28rpx; line-height: 1em;"
 | 
			
		||||
    >
 | 
			
		||||
      <l-painter-text text="¥" css="vertical-align: bottom" />
 | 
			
		||||
      <l-painter-text
 | 
			
		||||
        text="39"
 | 
			
		||||
        css="vertical-align: bottom; font-size: 58rpx"
 | 
			
		||||
      />
 | 
			
		||||
      <l-painter-text text=".39" css="vertical-align: bottom" />
 | 
			
		||||
      <l-painter-text
 | 
			
		||||
        text="¥59.99"
 | 
			
		||||
        css="vertical-align: bottom; padding-left: 10rpx; font-weight: normal; text-decoration: line-through; color: #999999"
 | 
			
		||||
      />
 | 
			
		||||
    </l-painter-view>
 | 
			
		||||
    <l-painter-view css="margin-top: 32rpx; font-size: 26rpx; color: #8c5400">
 | 
			
		||||
      <l-painter-text text="自营" css="color: #212121; background: #ffb400;" />
 | 
			
		||||
      <l-painter-text
 | 
			
		||||
        text="30天最低价"
 | 
			
		||||
        css="margin-left: 16rpx; background: #fff4d9; text-decoration: line-through;"
 | 
			
		||||
      />
 | 
			
		||||
      <l-painter-text
 | 
			
		||||
        text="满减优惠"
 | 
			
		||||
        css="margin-left: 16rpx; background: #fff4d9"
 | 
			
		||||
      />
 | 
			
		||||
      <l-painter-text
 | 
			
		||||
        text="超高好评"
 | 
			
		||||
        css="margin-left: 16rpx; background: #fff4d9"
 | 
			
		||||
      />
 | 
			
		||||
    </l-painter-view>
 | 
			
		||||
    <l-painter-view css="margin-top: 30rpx">
 | 
			
		||||
      <l-painter-text
 | 
			
		||||
        css="line-clamp: 2; color: #333333; line-height: 1.8em; font-size: 36rpx; width: 478rpx; padding-right:32rpx; box-sizing: border-box"
 | 
			
		||||
        text="360儿童电话手表9X 智能语音问答定位支付手表 4G全网通20米游泳级防水视频通话拍照手表男女孩星空蓝"
 | 
			
		||||
      ></l-painter-text>
 | 
			
		||||
      <l-painter-qrcode
 | 
			
		||||
        css="width: 128rpx; height: 128rpx;"
 | 
			
		||||
        text="limeui.qcoon.cn"
 | 
			
		||||
      ></l-painter-qrcode>
 | 
			
		||||
    </l-painter-view>
 | 
			
		||||
  </l-painter-view>
 | 
			
		||||
</l-painter>
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
```js
 | 
			
		||||
data() {
 | 
			
		||||
	return {
 | 
			
		||||
		path: ''
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
#### 方式二 JSON
 | 
			
		||||
 | 
			
		||||
```html
 | 
			
		||||
<image :src="path" mode="widthFix"></image>
 | 
			
		||||
<l-painter
 | 
			
		||||
  :board="poster"
 | 
			
		||||
  isCanvasToTempFilePath
 | 
			
		||||
  @success="path = $event"
 | 
			
		||||
  hidden
 | 
			
		||||
/>
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
```js
 | 
			
		||||
data() {
 | 
			
		||||
	return {
 | 
			
		||||
		path: '',
 | 
			
		||||
		poster: {
 | 
			
		||||
		    css: {
 | 
			
		||||
		        width: "750rpx",
 | 
			
		||||
		        paddingBottom: "40rpx",
 | 
			
		||||
		        background: "linear-gradient(,#000 0%, #ff5000 100%)"
 | 
			
		||||
		    },
 | 
			
		||||
		    views: [
 | 
			
		||||
		        {
 | 
			
		||||
		            src: "https://m.360buyimg.com/babel/jfs/t1/196317/32/13733/288158/60f4ea39E6fb378ed/d69205b1a8ed3c97.jpg",
 | 
			
		||||
		            type: "image",
 | 
			
		||||
		            css: {
 | 
			
		||||
		                background: "#fff",
 | 
			
		||||
		                objectFit: "cover",
 | 
			
		||||
		                marginLeft: "40rpx",
 | 
			
		||||
		                marginTop: "40rpx",
 | 
			
		||||
		                width: "84rpx",
 | 
			
		||||
		                border: "2rpx solid #fff",
 | 
			
		||||
		                boxSizing: "border-box",
 | 
			
		||||
		                height: "84rpx",
 | 
			
		||||
		                borderRadius: "50%"
 | 
			
		||||
		            }
 | 
			
		||||
		        },
 | 
			
		||||
		        {
 | 
			
		||||
		            type: "view",
 | 
			
		||||
		            css: {
 | 
			
		||||
		                marginTop: "40rpx",
 | 
			
		||||
		                paddingLeft: "20rpx",
 | 
			
		||||
		                display: "inline-block"
 | 
			
		||||
		            },
 | 
			
		||||
		            views: [
 | 
			
		||||
		                {
 | 
			
		||||
		                    text: "隔壁老王",
 | 
			
		||||
		                    type: "text",
 | 
			
		||||
		                    css: {
 | 
			
		||||
		                        display: "block",
 | 
			
		||||
		                        paddingBottom: "10rpx",
 | 
			
		||||
		                        color: "#fff",
 | 
			
		||||
		                        fontSize: "32rpx",
 | 
			
		||||
		                        fontWeight: "bold"
 | 
			
		||||
		                    }
 | 
			
		||||
		                },
 | 
			
		||||
		                {
 | 
			
		||||
		                    text: "为您挑选了一个好物",
 | 
			
		||||
		                    type: "text",
 | 
			
		||||
		                    css: {
 | 
			
		||||
		                        color: "rgba(255,255,255,.7)",
 | 
			
		||||
		                        fontSize: "24rpx"
 | 
			
		||||
		                    },
 | 
			
		||||
		                }
 | 
			
		||||
		            ],
 | 
			
		||||
		        },
 | 
			
		||||
		        {
 | 
			
		||||
		            css: {
 | 
			
		||||
		                marginLeft: "40rpx",
 | 
			
		||||
		                marginTop: "30rpx",
 | 
			
		||||
		                padding: "32rpx",
 | 
			
		||||
		                boxSizing: "border-box",
 | 
			
		||||
		                background: "#fff",
 | 
			
		||||
		                borderRadius: "16rpx",
 | 
			
		||||
		                width: "670rpx",
 | 
			
		||||
		                boxShadow: "0 20rpx 58rpx rgba(0,0,0,.15)"
 | 
			
		||||
		            },
 | 
			
		||||
		            views: [
 | 
			
		||||
		                {
 | 
			
		||||
							src: "https://m.360buyimg.com/babel/jfs/t1/196317/32/13733/288158/60f4ea39E6fb378ed/d69205b1a8ed3c97.jpg",
 | 
			
		||||
							type: "image",
 | 
			
		||||
		                    css: {
 | 
			
		||||
		                        objectFit: "cover",
 | 
			
		||||
		                        objectPosition: "50% 50%",
 | 
			
		||||
		                        width: "606rpx",
 | 
			
		||||
		                        height: "606rpx"
 | 
			
		||||
		                    },
 | 
			
		||||
		                }, {
 | 
			
		||||
		                    css: {
 | 
			
		||||
		                        marginTop: "32rpx",
 | 
			
		||||
		                        color: "#FF0000",
 | 
			
		||||
		                        fontWeight: "bold",
 | 
			
		||||
		                        fontSize: "28rpx",
 | 
			
		||||
		                        lineHeight: "1em"
 | 
			
		||||
		                    },
 | 
			
		||||
		                    views: [{
 | 
			
		||||
								text: "¥",
 | 
			
		||||
								type: "text",
 | 
			
		||||
		                        css: {
 | 
			
		||||
		                            verticalAlign: "bottom"
 | 
			
		||||
		                        },
 | 
			
		||||
		                    }, {
 | 
			
		||||
								text: "39",
 | 
			
		||||
								type: "text",
 | 
			
		||||
		                        css: {
 | 
			
		||||
		                            verticalAlign: "bottom",
 | 
			
		||||
		                            fontSize: "58rpx"
 | 
			
		||||
		                        },
 | 
			
		||||
		                    }, {
 | 
			
		||||
								text: ".39",
 | 
			
		||||
								type: "text",
 | 
			
		||||
		                        css: {
 | 
			
		||||
		                            verticalAlign: "bottom"
 | 
			
		||||
		                        },
 | 
			
		||||
		                    }, {
 | 
			
		||||
								text: "¥59.99",
 | 
			
		||||
								type: "text",
 | 
			
		||||
		                        css: {
 | 
			
		||||
		                            verticalAlign: "bottom",
 | 
			
		||||
		                            paddingLeft: "10rpx",
 | 
			
		||||
		                            fontWeight: "normal",
 | 
			
		||||
		                            textDecoration: "line-through",
 | 
			
		||||
		                            color: "#999999"
 | 
			
		||||
		                        }
 | 
			
		||||
		                    }],
 | 
			
		||||
 | 
			
		||||
		                    type: "view"
 | 
			
		||||
		                }, {
 | 
			
		||||
		                    css: {
 | 
			
		||||
		                        marginTop: "32rpx",
 | 
			
		||||
		                        fontSize: "26rpx",
 | 
			
		||||
		                        color: "#8c5400"
 | 
			
		||||
		                    },
 | 
			
		||||
		                    views: [{
 | 
			
		||||
								text: "自营",
 | 
			
		||||
								type: "text",
 | 
			
		||||
		                        css: {
 | 
			
		||||
		                            color: "#212121",
 | 
			
		||||
		                            background: "#ffb400"
 | 
			
		||||
		                        },
 | 
			
		||||
		                    }, {
 | 
			
		||||
								text: "30天最低价",
 | 
			
		||||
								type: "text",
 | 
			
		||||
		                        css: {
 | 
			
		||||
		                            marginLeft: "16rpx",
 | 
			
		||||
		                            background: "#fff4d9",
 | 
			
		||||
		                            textDecoration: "line-through"
 | 
			
		||||
		                        },
 | 
			
		||||
		                    }, {
 | 
			
		||||
								text: "满减优惠",
 | 
			
		||||
								type: "text",
 | 
			
		||||
		                        css: {
 | 
			
		||||
		                            marginLeft: "16rpx",
 | 
			
		||||
		                            background: "#fff4d9"
 | 
			
		||||
		                        },
 | 
			
		||||
		                    }, {
 | 
			
		||||
								text: "超高好评",
 | 
			
		||||
								type: "text",
 | 
			
		||||
		                        css: {
 | 
			
		||||
		                            marginLeft: "16rpx",
 | 
			
		||||
		                            background: "#fff4d9"
 | 
			
		||||
		                        },
 | 
			
		||||
 | 
			
		||||
		                    }],
 | 
			
		||||
 | 
			
		||||
		                    type: "view"
 | 
			
		||||
		                }, {
 | 
			
		||||
		                    css: {
 | 
			
		||||
		                        marginTop: "30rpx"
 | 
			
		||||
		                    },
 | 
			
		||||
		                    views: [
 | 
			
		||||
								{
 | 
			
		||||
									text: "360儿童电话手表9X 智能语音问答定位支付手表 4G全网通20米游泳级防水视频通话拍照手表男女孩星空蓝",
 | 
			
		||||
									type: "text",
 | 
			
		||||
									css: {
 | 
			
		||||
										paddingRight: "32rpx",
 | 
			
		||||
										boxSizing: "border-box",
 | 
			
		||||
										lineClamp: 2,
 | 
			
		||||
										color: "#333333",
 | 
			
		||||
										lineHeight: "1.8em",
 | 
			
		||||
										fontSize: "36rpx",
 | 
			
		||||
										width: "478rpx"
 | 
			
		||||
		                        },
 | 
			
		||||
		                    }, {
 | 
			
		||||
								text: "limeui.qcoon.cn",
 | 
			
		||||
								type: "qrcode",
 | 
			
		||||
		                        css: {
 | 
			
		||||
		                            width: "128rpx",
 | 
			
		||||
		                            height: "128rpx",
 | 
			
		||||
		                        },
 | 
			
		||||
 | 
			
		||||
		                    }],
 | 
			
		||||
		                    type: "view"
 | 
			
		||||
		                }],
 | 
			
		||||
		            type: "view"
 | 
			
		||||
		        }
 | 
			
		||||
		    ]
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### 自定义字体
 | 
			
		||||
- 需要平台的支持,已知微信小程序支持,其它的没试过,如果可行请告之
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
// 需要在app.vue中下载字体
 | 
			
		||||
uni.loadFontFace({
 | 
			
		||||
	global:true,
 | 
			
		||||
	scopes: ['native'],
 | 
			
		||||
	family: '自定义字体名称',
 | 
			
		||||
	source: 'url("https://sungd.github.io/Pacifico.ttf")',
 | 
			
		||||
  
 | 
			
		||||
	success() {
 | 
			
		||||
	  console.log('success')
 | 
			
		||||
  }
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
// 然后就可以在插件的css中写font-family: '自定义字体名称'
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### Nvue
 | 
			
		||||
- 必须为HBX 3.4.11及以上
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### 原生小程序
 | 
			
		||||
 | 
			
		||||
- 插件里的`painter.js`支持在原生小程序中使用
 | 
			
		||||
- new Painter 之后在`source`里传入 JSON
 | 
			
		||||
- 再调用`render`绘制海报
 | 
			
		||||
- 如需生成图片,请查看微信小程序 cavnas 的[canvasToTempFilePath](https://developers.weixin.qq.com/miniprogram/dev/api/canvas/wx.canvasToTempFilePath.html)
 | 
			
		||||
 | 
			
		||||
```html
 | 
			
		||||
<canvas type="2d" id="painter" style="width: 100%"></canvas>
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
```js
 | 
			
		||||
import { Painter } from "./painter";
 | 
			
		||||
page({
 | 
			
		||||
  data: {
 | 
			
		||||
    poster: {
 | 
			
		||||
      css: {
 | 
			
		||||
        width: "750rpx",
 | 
			
		||||
      },
 | 
			
		||||
      views: [
 | 
			
		||||
        {
 | 
			
		||||
          type: "view",
 | 
			
		||||
          css: {
 | 
			
		||||
            background: "#d2d4c8",
 | 
			
		||||
            paddingTop: "100rpx",
 | 
			
		||||
          },
 | 
			
		||||
          views: [
 | 
			
		||||
            {
 | 
			
		||||
              type: "view",
 | 
			
		||||
              css: {
 | 
			
		||||
                background: "#5f7470",
 | 
			
		||||
                width: "33.33%",
 | 
			
		||||
                height: "100rpx",
 | 
			
		||||
                display: "inline-block",
 | 
			
		||||
              },
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
              type: "view",
 | 
			
		||||
              css: {
 | 
			
		||||
                background: "#889696",
 | 
			
		||||
                width: "33.33%",
 | 
			
		||||
                height: "100rpx",
 | 
			
		||||
                display: "inline-block",
 | 
			
		||||
              },
 | 
			
		||||
            },
 | 
			
		||||
            {
 | 
			
		||||
              type: "view",
 | 
			
		||||
              css: {
 | 
			
		||||
                background: "#b8bdb5",
 | 
			
		||||
                width: "33.33%",
 | 
			
		||||
                height: "100rpx",
 | 
			
		||||
                display: "inline-block",
 | 
			
		||||
              },
 | 
			
		||||
            },
 | 
			
		||||
          ],
 | 
			
		||||
        },
 | 
			
		||||
      ],
 | 
			
		||||
    },
 | 
			
		||||
  },
 | 
			
		||||
  async onLoad() {
 | 
			
		||||
    const res = await this.getCentext();
 | 
			
		||||
    const painter = new Painter(res);
 | 
			
		||||
    // 返回计算布局后的整个内容尺寸
 | 
			
		||||
    const { width, height } = await painter.source(this.data.poster);
 | 
			
		||||
    // 得到计算后的尺寸后 可给canvas尺寸赋值,达到动态响应效果
 | 
			
		||||
    // 渲染
 | 
			
		||||
    await painter.render();
 | 
			
		||||
  },
 | 
			
		||||
  // 获取canvas 2d
 | 
			
		||||
  // 非2d 需要传一个 createImage 方法用于获取图片信息 即把 getImageInfo 的 success 通过 promise resolve 返回
 | 
			
		||||
  getCentext() {
 | 
			
		||||
    return new Promise((resolve) => {
 | 
			
		||||
      wx.createSelectorQuery()
 | 
			
		||||
        .select(`#painter`)
 | 
			
		||||
        .node()
 | 
			
		||||
        .exec((res) => {
 | 
			
		||||
          let { node: canvas } = res[0];
 | 
			
		||||
          resolve({
 | 
			
		||||
            canvas,
 | 
			
		||||
            context: canvas.getContext("2d"),
 | 
			
		||||
            width: canvas.width,
 | 
			
		||||
            height: canvas.height,
 | 
			
		||||
			// createImage: getImageInfo()
 | 
			
		||||
            pixelRatio: 2,
 | 
			
		||||
          });
 | 
			
		||||
        });
 | 
			
		||||
    });
 | 
			
		||||
  },
 | 
			
		||||
});
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
### 旧版(1.6.x)更新
 | 
			
		||||
 | 
			
		||||
- 由于 1.8.x 版放弃了以定位的方式,所以 1.6.x 版更新之后要每个样式都加上`position: absolute`
 | 
			
		||||
- 旧版的 `image` mode 模式被放弃,使用`object-fit`
 | 
			
		||||
- 旧版的 `isRenderImage` 改成 `is-canvas-to-temp-file-path`
 | 
			
		||||
- 旧版的 `maxLines` 改成 `line-clamp`
 | 
			
		||||
 | 
			
		||||
## API
 | 
			
		||||
 | 
			
		||||
### Props
 | 
			
		||||
 | 
			
		||||
| 参数                       | 说明                                                         | 类型             | 默认值       |
 | 
			
		||||
| -------------------------- | ------------------------------------------------------------ | ---------------- | ------------ |
 | 
			
		||||
| board                      | JSON 方式的海报元素对象集                                    | <em>object</em>  | -            |
 | 
			
		||||
| css                        | 海报内容最外层的样式,可以理解为`body`                           | <em>object</em>  | 参数请向下看 |
 | 
			
		||||
| custom-style               | canvas 元素的样式                                            | <em>string</em>  |              |
 | 
			
		||||
| hidden               		 | 隐藏画板                                                    | <em>boolean</em>  |   `false`    |
 | 
			
		||||
| is-canvas-to-temp-file-path | 是否生成图片,在`@success`事件接收图片地址                   | <em>boolean</em> | `false`      |
 | 
			
		||||
| after-delay                | 生成图片错乱,可延时生成图片                                 | <em>number</em>  | `100`        |
 | 
			
		||||
| type                       | canvas 类型,对微信头条支付宝小程序可有效,可选值:`2d`,`''` | <em>string</em>  | `2d`         |
 | 
			
		||||
| file-type                  | 生成图片的后缀类型, 可选值:`png`、`jpg`                     | <em>string</em>  | `png`        |
 | 
			
		||||
| path-type                  | 生成图片路径类型,可选值`url`、`base64`                      | <em>string</em>  | `-`          |
 | 
			
		||||
| pixel-ratio                | 生成图片的像素密度,默认为对应手机的像素密度,`nvue`无效     | <em>number</em>  | `-`          |
 | 
			
		||||
| hidpi                | H5和APP是否使用高清处理     | <em>boolean</em>  | `true`          |
 | 
			
		||||
| width                      | **废弃** 画板的宽度,一般只用于通过内部方法时加上            | <em>number</em>  | ``           |
 | 
			
		||||
| height                     | **废弃** 画板的高度 ,同上                                   | <em>number</em>  | ``           |
 | 
			
		||||
 | 
			
		||||
### css
 | 
			
		||||
| 属性名                                                                              | 支持的值或类型                                                                                                                                                                       | 默认值   |
 | 
			
		||||
| ----------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------- |
 | 
			
		||||
| (min\max)width                                                                      | 支持`%`、`rpx`、`px`                                                                                                                                                                 | -        |
 | 
			
		||||
| height                                                                              | 同上                                                                                                                                                                                 | -        |
 | 
			
		||||
| color                                                                               | `string`                                                                                                                                                                             | -        |
 | 
			
		||||
| position                                                                            | 定位,可选值:`absolute`、`fixed`                                                                                                                                                    | -        |
 | 
			
		||||
| ↳ left、top、right、bottom                                                          | 配合`position`才生效,支持`%`、`rpx`、`px`                                                                                                                                           | -        |
 | 
			
		||||
| margin                                                                              | 可简写或各方向分别写,如:`margin-top`,支持`auto`、`rpx`、`px`                                                                                                                      | -        |
 | 
			
		||||
| padding                                                                             | 可简写或各方向分别写,支持`rpx`、`px`                                                                                                                                                | -        |
 | 
			
		||||
| border                                                                              | 可简写或各个值分开写:`border-width`、`border-style` 、`border-color`,简写请按顺序写                                                                                                | -        |
 | 
			
		||||
| line-clamp                                                                          | `number`,超过行数显示省略号                                                                                                                                                         | -        |
 | 
			
		||||
| vertical-align                                                                      | 文字垂直对齐,可选值:`bottom`、`top`、`middle`                                                                                                                                      | `middle` |
 | 
			
		||||
| line-height                                                                         | 文字行高,支持`rpx`、`px`、`em`                                                                                                                                                      | `1.4em`  |
 | 
			
		||||
| font-weight                                                                         | 文字粗细,可选值:`normal`、`bold`                                                                                                                                                   | `normal` |
 | 
			
		||||
| font-size                                                                           | 文字大小,`string`,支持`rpx`、`px`                                                                                                                                                  | `14px`   |
 | 
			
		||||
| text-decoration                                                                     | 文本修饰,可选值:`underline` 、`line-through`、`overline`                                                                                                                           | -        |
 | 
			
		||||
| text-stroke                                                                         | 文字描边,可简写或各个值分开写,如:`text-stroke-color`, `text-stroke-width`                                                                                                              | -        |
 | 
			
		||||
| text-align                                                                          | 文本水平对齐,可选值:`right` 、`center`                                                                                                                                             | `left`   |
 | 
			
		||||
| display                                                                             | 框类型,可选值:`block`、`inline-block`、`flex`、`none`,当为`none`时是不渲染该段, `flex`功能简陋。                                                                                                            | -        |
 | 
			
		||||
| flex                                                                                | 配合 display: flex; 属性定义了在分配多余空间,目前只用为数值如: flex: 1                                                                                                           | -        |
 | 
			
		||||
| align-self                                                                          | 配合 display: flex; 单个项目垂直轴对齐方式: `flex-start` `flex-end` `center`                                                                                                         | `flex-start`        |
 | 
			
		||||
| justify-content                                                                     | 配合 display: flex; 水平轴对齐方式: `flex-start` `flex-end` `center`                                                                                                         | `flex-start`        |
 | 
			
		||||
| align-items                                                                         | 配合 display: flex; 垂直轴对齐方式: `flex-start` `flex-end` `center`                                                                                                  | `flex-start`        |
 | 
			
		||||
| border-radius                                                                       | 圆角边框,支持`%`、`rpx`、`px`                                                                                                                                                       | -        |
 | 
			
		||||
| box-sizing                                                                          | 可选值:`border-box`                                                                                                                                                                 | -        |
 | 
			
		||||
| box-shadow                                                                          | 投影                                                                                                                                                                                 | -        |
 | 
			
		||||
| background(color)                                                                   | 支持渐变,但必须写百分比!如:`linear-gradient(,#ff971b 0%, #ff5000 100%)`、`radial-gradient(#0ff 15%, #f0f 60%)`,目前 radial-gradient 渐变的圆心为元素中点,半径为最长边,不支持设置 | -        |
 | 
			
		||||
| background-clip                                                                	  | 文字渐变,配合`background`背景渐变,设置`background-clip: text` 达到文字渐变效果 | -        |
 | 
			
		||||
| background-image                                                                    | view 元素背景:`url(src)`,若只是设置背景图,请不要设置`background-repeat`                                                                                                                                                           | -        |
 | 
			
		||||
| background-repeat                                                                   | 设置是否及如何重复背景纹理,可选值:`repeat`、`repeat-x`、`repeat-y`、`no-repeat`                                                                                                    | `repeat` |
 | 
			
		||||
| [object-fit](https://developer.mozilla.org/zh-CN/docs/Web/CSS/object-fit/)          | 图片元素适应容器方式,类似于`mode`,可选值:`cover`、 `contain`、 `fill`、 `none`                                                                                                      | -        |
 | 
			
		||||
| [object-position](https://developer.mozilla.org/zh-CN/docs/Web/CSS/object-position) | 图片的对齐方式,配合`object-fit`使用                                                                                                                                                 | -        |
 | 
			
		||||
 | 
			
		||||
### 图片填充模式 object-fit
 | 
			
		||||
 | 
			
		||||
| 名称    | 含义                                                   |
 | 
			
		||||
| ------- | ------------------------------------------------------ |
 | 
			
		||||
| contain | 保持宽高缩放图片,使图片的长边能完全显示出来           |
 | 
			
		||||
| cover   | 保持宽高缩放图片,使图片的短边能完全显示出来,裁剪长边 |
 | 
			
		||||
| fill    | 拉伸图片,使图片填满元素                               |
 | 
			
		||||
| none    | 保持图片原有尺寸                                       |
 | 
			
		||||
 | 
			
		||||
### 事件 Events
 | 
			
		||||
 | 
			
		||||
| 事件名   | 说明                                                             | 返回值 |
 | 
			
		||||
| -------- | ---------------------------------------------------------------- | ------ |
 | 
			
		||||
| success  | 生成图片成功,若使用`is-canvas-to-temp-filePath` 可以接收图片地址 | path   |
 | 
			
		||||
| fail     | 生成图片失败                                                     | error  |
 | 
			
		||||
| done     | 绘制成功                                                         |        |
 | 
			
		||||
| progress | 绘制进度                                                         | number |
 | 
			
		||||
 | 
			
		||||
### 暴露函数 Expose
 | 
			
		||||
| 事件名   | 说明                                                             | 返回值 |
 | 
			
		||||
| -------- | ---------------------------------------------------------------- | ------ |
 | 
			
		||||
| render(object)   |  渲染器,传入JSON 绘制海报 | promise   |
 | 
			
		||||
| [canvasToTempFilePath](https://uniapp.dcloud.io/api/canvas/canvasToTempFilePath.html#canvastotempfilepath)(object)   | 把当前画布指定区域的内容导出生成指定大小的图片,并返回文件临时路径。    |   |
 | 
			
		||||
| canvasToTempFilePathSync(object)    | 同步接口,同上                                                         |        |
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
## 常见问题
 | 
			
		||||
 | 
			
		||||
- 1、H5 端使用网络图片需要解决跨域问题。
 | 
			
		||||
- 2、小程序使用网络图片需要去公众平台增加下载白名单!二级域名也需要配!
 | 
			
		||||
- 3、H5 端生成图片是 base64,有时显示只有一半可以使用原生标签`<IMG/>`
 | 
			
		||||
- 4、发生保存图片倾斜变形或提示 native buffer exceed size limit 时,使用 pixel-ratio="2"参数,降分辨率。
 | 
			
		||||
- 5、h5 保存图片不需要调接口,提示用户长按图片保存。
 | 
			
		||||
- 6、画板不能隐藏,包括`v-if`,`v-show`、`display:none`、`opacity:0`,另外也不要把画板放在弹窗里。如果需要隐藏画板请设置 `custom-style="position: fixed; left: 200%"`
 | 
			
		||||
- 7、微信小程序真机调试请使用 **真机调试2.0**,不支持1.0。
 | 
			
		||||
- 8、微信小程序打开调试时可以生但并闭无法生成时,这种情况一般是没有在公众号配置download域名
 | 
			
		||||
- 9、HBX 3.4.5之前的版本不支持vue3
 | 
			
		||||
- 10、在微信开发工具上 canvas 层级最高无法zindex,并不影响真机
 | 
			
		||||
- 11、请不要导入非uni_modules插件
 | 
			
		||||
- 12、关于QQ小程序 报 Propertyor method"toJSON"is not defined 请把基础库调到 1.50.3
 | 
			
		||||
- 13、支付宝小程序 IDE 不支持 生成图片 请以真机调试结果为准
 | 
			
		||||
- 14、返回值为字符串 `data:,` 大概是尺寸超过限制,设置 pixel-ratio="2"
 | 
			
		||||
- 华为手机 APP 上无法生成图片,请使用 HBX2.9.11++(已过时,忽略这条)
 | 
			
		||||
- IOS APP 请勿使用 HBX2.9.3.20201014 的版本!这个版本无法生成图片。(已过时,忽略这条)
 | 
			
		||||
- 苹果微信 7.0.20 存在闪退和图片无法 onload 为微信 bug(已过时,忽略这条)
 | 
			
		||||
- 微信小程序 IOS 旧接口 如父级设置圆角,子级也设会导致子级的失效,为旧接口BUG。
 | 
			
		||||
- 微信小程序 安卓 旧接口 如使用图片必须加背景色,为旧接口BUG。
 | 
			
		||||
- 微信小程序 安卓端 [图片可能在首次可以加载成功,再次加载会不触发任何事件](https://developers.weixin.qq.com/community/develop/doc/000ee2b8dacf4009337f51f4556800?highLine=canvas%25202d%2520createImage),临时解决方法是给图片加个时间戳
 | 
			
		||||
## 打赏
 | 
			
		||||
 | 
			
		||||
如果你觉得本插件,解决了你的问题,赠人玫瑰,手留余香。
 | 
			
		||||
 | 
			
		||||

 | 
			
		||||

 | 
			
		||||
							
								
								
									
										4
									
								
								unpackage/dist/build/mp-weixin/app.js
									
									
									
									
										vendored
									
									
								
							
							
						
						@ -1,4 +0,0 @@
 | 
			
		||||
 | 
			
		||||
require('./common/runtime.js')
 | 
			
		||||
require('./common/vendor.js')
 | 
			
		||||
require('./common/main.js')
 | 
			
		||||
							
								
								
									
										43
									
								
								unpackage/dist/build/mp-weixin/app.json
									
									
									
									
										vendored
									
									
								
							
							
						
						@ -1,43 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "pages": [
 | 
			
		||||
    "pages/index/index",
 | 
			
		||||
    "pages/index/home",
 | 
			
		||||
    "pages/index/service",
 | 
			
		||||
    "pages/index/pizz",
 | 
			
		||||
    "pages/index/user",
 | 
			
		||||
    "pages/index/discovery",
 | 
			
		||||
    "pages/index/directory",
 | 
			
		||||
    "pages/index/user_info",
 | 
			
		||||
    "pages/index/new_info",
 | 
			
		||||
    "pages/index/events_list",
 | 
			
		||||
    "pages/index/knowledge_list",
 | 
			
		||||
    "pages/index/goods_info",
 | 
			
		||||
    "pages/index/goods_list",
 | 
			
		||||
    "pages/index/search/search",
 | 
			
		||||
    "pages/index/pizz_info",
 | 
			
		||||
    "pages/index/apply_in",
 | 
			
		||||
    "pages/index/enter_in",
 | 
			
		||||
    "pages/index/goods_my",
 | 
			
		||||
    "pages/index/events_my",
 | 
			
		||||
    "pages/index/my_card",
 | 
			
		||||
    "pages/index/my_pizz",
 | 
			
		||||
    "pages/index/my_apply",
 | 
			
		||||
    "pages/index/my_msg",
 | 
			
		||||
    "pages/index/my_assist",
 | 
			
		||||
    "pages/index/my_idea",
 | 
			
		||||
    "pages/index/my_settings",
 | 
			
		||||
    "pages/index/my_edit",
 | 
			
		||||
    "pages/index/tissue",
 | 
			
		||||
    "pages/index/my_desc",
 | 
			
		||||
    "pages/index/event_info"
 | 
			
		||||
  ],
 | 
			
		||||
  "subPackages": [],
 | 
			
		||||
  "window": {
 | 
			
		||||
    "navigationStyle": "custom",
 | 
			
		||||
    "navigationBarTextStyle": "black",
 | 
			
		||||
    "navigationBarTitleText": "uni-app",
 | 
			
		||||
    "navigationBarBackgroundColor": "#F8F8F8",
 | 
			
		||||
    "backgroundColor": "#F8F8F8"
 | 
			
		||||
  },
 | 
			
		||||
  "usingComponents": {}
 | 
			
		||||
}
 | 
			
		||||
							
								
								
									
										3
									
								
								unpackage/dist/build/mp-weixin/app.wxss
									
									
									
									
										vendored
									
									
								
							
							
						
						@ -1,3 +0,0 @@
 | 
			
		||||
@import './common/main.wxss';
 | 
			
		||||
 | 
			
		||||
[data-custom-hidden="true"],[bind-data-custom-hidden="true"]{display: none !important;}
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["common/main"],{3193:function(e,t,n){"use strict";var o=n("afec"),a=n.n(o);a.a},"5c84":function(e,t,n){"use strict";n.r(t);var o=n("5d49");for(var a in o)["default"].indexOf(a)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(a);n("3193");var r=n("f0c5"),c=Object(r["a"])(o["default"],void 0,void 0,!1,null,null,null,!1,void 0,void 0);t["default"]=c.exports},"5d49":function(e,t,n){"use strict";n.r(t);var o=n("7f06"),a=n.n(o);for(var r in o)["default"].indexOf(r)<0&&function(e){n.d(t,e,(function(){return o[e]}))}(r);t["default"]=a.a},"7f06":function(e,t,n){"use strict";(function(e,o){var a=n("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=a(n("66fd")),c=a(n("de98")),i=a(n("62e5")),u={onLaunch:function(){var t=e.getStorageSync("Gid");if(t&&c.default.commit("$tStore",{name:"Gid",value:t}),e.getSystemInfo({success:function(e){var t=e.system.toLowerCase(),n=e.platform.toLowerCase();-1==n.indexOf("ios")||-1==t.indexOf("ios")&&-1==t.indexOf("macos")?-1!=n.indexOf("android")&&-1!=t.indexOf("android")?r.default.prototype.SystemPlatform="android":r.default.prototype.SystemPlatform="devtools":r.default.prototype.SystemPlatform="apple"}}),(0,i.default)().then((function(e){console.log(e),c.default.commit("$tStore",{name:"vuex_status_bar_height",value:e.statusBarHeight}),c.default.commit("$tStore",{name:"vuex_custom_bar_height",value:e.customBarHeight})})),o.canIUse("getUpdateManager")){var n=o.getUpdateManager();n&&n.onCheckForUpdate((function(t){t.hasUpdate&&(n.onUpdateReady((function(){e.showModal({title:"更新提示",content:"新版本已经准备就绪,是否需要重新启动应用?",success:function(t){t.confirm&&(e.clearStorageSync(),n.applyUpdate())}})})),n.onUpdateFailed((function(){e.showModal({title:"已有新版本上线",content:"小程序自动更新失败,请删除该小程序后重新搜索打开哟~~~",showCancel:!1})})))}))}else e.showModal({title:"提示",content:"当前微信版本过低,无法使用该功能,请更新到最新的微信后再重试。",showCancel:!1})},onShow:function(){},onHide:function(){},methods:{addWidthToImages:function(e){return e=e.replace(/(<img\b[^>]*\bstyle\s*=\s*['"])([^'"]*)(['"][^>]*>)/g,(function(e,t,n,o){return t+n.trim()+";width: 100%"+o})),e=e.replace(/(<img\b(?![^>]*\bstyle\s*=)[^>]*>)/g,(function(e,t){return t.replace(/\/?>$/,' style="width: 100%;" />')})),e}}};t.default=u}).call(this,n("543d")["default"],n("bc2e")["default"])},"9ce0":function(e,t,n){"use strict";(function(e,t){var o=n("4ea4"),a=o(n("9523"));n("34f1");var r=o(n("5c84")),c=o(n("de98")),i=o(n("66fd")),u=o(n("fafd")),f=n("8ab9");function d(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);t&&(o=o.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,o)}return n}e.__webpack_require_UNI_MP_PLUGIN__=n,i.default.config.productionTip=!1,r.default.mpType="app",i.default.use(u.default);var l=n("716f");i.default.mixin(l);var s=n("159f");i.default.mixin(s),i.default.prototype.$wxshare=f.wxshare;var p=new i.default(function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?d(Object(n),!0).forEach((function(t){(0,a.default)(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({store:c.default},r.default));t(p).$mount()}).call(this,n("bc2e")["default"],n("543d")["createApp"])},afec:function(e,t,n){}},[["9ce0","common/runtime","common/vendor"]]]);
 | 
			
		||||
							
								
								
									
										95
									
								
								unpackage/dist/build/mp-weixin/common/main.wxss
									
									
									
									
										vendored
									
									
								
							
							
						
						
							
								
								
									
										23
									
								
								unpackage/dist/build/mp-weixin/common/vendor.js
									
									
									
									
										vendored
									
									
								
							
							
						
						@ -1,16 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "navigationBarTitleText": "智慧云商协",
 | 
			
		||||
  "enablePullDownRefresh": false,
 | 
			
		||||
  "usingComponents": {
 | 
			
		||||
    "tn-nav-bar": "/tuniao-ui/components/tn-nav-bar/tn-nav-bar",
 | 
			
		||||
    "tn-tabs": "/tuniao-ui/components/tn-tabs/tn-tabs",
 | 
			
		||||
    "tn-steps": "/tuniao-ui/components/tn-steps/tn-steps",
 | 
			
		||||
    "tn-checkbox": "/tuniao-ui/components/tn-checkbox/tn-checkbox",
 | 
			
		||||
    "tn-button": "/tuniao-ui/components/tn-button/tn-button",
 | 
			
		||||
    "tn-select": "/tuniao-ui/components/tn-select/tn-select",
 | 
			
		||||
    "tn-calendar": "/tuniao-ui/components/tn-calendar/tn-calendar",
 | 
			
		||||
    "tn-image-upload": "/tuniao-ui/components/tn-image-upload/tn-image-upload",
 | 
			
		||||
    "tn-radio-group": "/tuniao-ui/components/tn-radio-group/tn-radio-group",
 | 
			
		||||
    "tn-radio": "/tuniao-ui/components/tn-radio/tn-radio"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
.tn-tabbar-height.data-v-6994b536{min-height:100rpx;height:calc(120rpx + env(safe-area-inset-bottom) / 2)}.tn-footerfixed.data-v-6994b536{position:fixed;width:100%;bottom:calc(30rpx + env(safe-area-inset-bottom));z-index:1024;box-shadow:0 1rpx 6rpx transparent}.tn-tag-content__item.data-v-6994b536{display:inline-block;line-height:45rpx;padding:10rpx 30rpx;margin:20rpx 20rpx 5rpx 0rpx}.tn-tag-content__item--prefix.data-v-6994b536{padding-right:10rpx}
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/directory"],{"0039":function(t,n,e){"use strict";e.r(n);var i=e("f9d3"),a=e.n(i);for(var o in i)["default"].indexOf(o)<0&&function(t){e.d(n,t,(function(){return i[t]}))}(o);n["default"]=a.a},3918:function(t,n,e){"use strict";e.d(n,"b",(function(){return a})),e.d(n,"c",(function(){return o})),e.d(n,"a",(function(){return i}));var i={tnNavBar:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-nav-bar/tn-nav-bar")]).then(e.bind(null,"5d27"))},tnTabs:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-tabs/tn-tabs")]).then(e.bind(null,"8772"))},tnSelect:function(){return e.e("tuniao-ui/components/tn-select/tn-select").then(e.bind(null,"eb22"))}},a=function(){var t=this,n=t.$createElement,e=(t._self._c,t.__map(t.industry_list,(function(n,e){var i=t.__get_orig(n),a=t.tabbarItemClass(e);return{$orig:i,m0:a}})));t._isMounted||(t.e0=function(n){t.selectShow=!0}),t.$mp.data=Object.assign({},{$root:{l0:e}})},o=[]},a554:function(t,n,e){},c0a9:function(t,n,e){"use strict";var i=e("a554"),a=e.n(i);a.a},d612:function(t,n,e){"use strict";(function(t,n){var i=e("4ea4");e("34f1");i(e("66fd"));var a=i(e("dfc2"));t.__webpack_require_UNI_MP_PLUGIN__=e,n(a.default)}).call(this,e("bc2e")["default"],e("543d")["createPage"])},dfc2:function(t,n,e){"use strict";e.r(n);var i=e("3918"),a=e("0039");for(var o in a)["default"].indexOf(o)<0&&function(t){e.d(n,t,(function(){return a[t]}))}(o);e("c0a9");var r=e("f0c5"),s=Object(r["a"])(a["default"],i["b"],i["c"],!1,null,"1f399f8a",null,!1,i["a"],void 0);n["default"]=s.exports},f9d3:function(t,n,e){"use strict";(function(t){var i=e("4ea4");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var a=e("0c91"),o=i(e("de98")),r={data:function(){return{list:[],topCurrent:0,tabbarIndex:0,tabbarItemInfo:[],scrollViewBasicTop:0,scrollViewHeight:0,leftScrollViewTop:0,rightScrollViewTop:0,currentTabbarIndex:0,apiImgUrl:this.$store.state.imgUrl,industry_list:[],leftId:0,selectShow:!1,HomeTitle:"",selectList:[],gid:o.default.state.Gid}},computed:{tabbarItemClass:function(){var t=this;return function(n){if(n===t.currentTabbarIndex)return"tn-classify__tabbar__item--active tn-bg-white";var e="";return t.currentTabbarIndex>0&&n===t.currentTabbarIndex-1&&(e+=" tn-classify__tabbar__item--active--prev"),t.currentTabbarIndex<t.industry_list.length&&n===t.currentTabbarIndex+1&&(e+=" tn-classify__tabbar__item--active--next"),e}}},onLoad:function(t){console.log(t.id),"undefined"!=typeof t.id&&(this.gid=t.id),this.getIndustryList(),this.getAssociationIndex()},methods:{confirm:function(t){var n=t[0];this.list=[],this.gid=n.value,this.getAssociationIndex(),this.getIndustryList()},getAssociationIndex:function(){var n=this;(0,a.associationIndex)().then((function(t){if(console.log(t),1==t.code){var e=t.data,i=e.map((function(t){return{value:t.id,label:t.association_name}})),a=i.find((function(t){return t.value==n.gid}));n.HomeTitle=a.label,n.selectList=i}})).catch((function(n){t.showToast({title:n,icon:"none",duration:2e3})}))},getIndustryList:function(){var n=this;(0,a.newIndustryIndex)({association_id:this.gid}).then((function(t){console.log(t),1==t.code&&(n.industry_list=t.data,n.leftId=t.data[0].id,n.getAddressList())})).catch((function(n){t.showToast({title:n,icon:"none",duration:2e3})}))},getAddressList:function(){var n=this;(0,a.addressList)({association_id:this.gid,industry_id:this.leftId}).then((function(t){console.log(t),1==t.code&&(n.list=t.data.ret)})).catch((function(n){t.showToast({title:n,icon:"none",duration:2e3})}))},clickClassifyNav:function(t){this.currentTabbarIndex=t,this.leftId=this.industry_list[t].id,this.list=[],this.getAddressList()},handleLeftScrollView:function(t){var n=this.tabbarItemInfo[t].top-this.scrollViewBasicTop;n>this.scrollViewHeight/2?this.leftScrollViewTop=n-this.scrollViewHeight/2+this.tabbarItemInfo[t].height:this.leftScrollViewTop=0},switchClassifyContent:function(){var t=this;this.rightScrollViewTop=1,this.$nextTick((function(){t.rightScrollViewTop=0}))},tn:function(n){t.navigateTo({url:n})},goBack:function(){getCurrentPages().length>1?t.navigateBack():t.redirectTo({url:"/pages/index/index"})}}};n.default=r}).call(this,e("543d")["default"])}},[["d612","common/runtime","common/vendor"]]]);
 | 
			
		||||
@ -1,9 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "navigationBarTitleText": "智慧云商协",
 | 
			
		||||
  "enablePullDownRefresh": false,
 | 
			
		||||
  "usingComponents": {
 | 
			
		||||
    "tn-nav-bar": "/tuniao-ui/components/tn-nav-bar/tn-nav-bar",
 | 
			
		||||
    "tn-tabs": "/tuniao-ui/components/tn-tabs/tn-tabs",
 | 
			
		||||
    "tn-select": "/tuniao-ui/components/tn-select/tn-select"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
<view style="background-color:#EBF4F7;letter-spacing:1rpx;" class="data-v-1f399f8a"><tn-nav-bar vue-id="7cb8b842-1" isBack="{{false}}" backTitle bottomShadow="{{true}}" backgroundColor="#FFFFFF" class="data-v-1f399f8a" bind:__l="__l" vue-slots="{{['default']}}"><view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left data-v-1f399f8a"><view data-event-opts="{{[['tap',[['goBack']]]]}}" style="padding-left:15rpx;" bindtap="__e" class="data-v-1f399f8a"><text class="tn-icon-left data-v-1f399f8a" style="font-size:40rpx;"></text></view><view class="tn-margin-top data-v-1f399f8a" style="text-shadow:1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;"><tn-tabs vue-id="{{('7cb8b842-2')+','+('7cb8b842-1')}}" list="{{[{name:'会员名录'}]}}" current="{{topCurrent}}" activeColor="#000" bold="{{false}}" fontSize="{{36}}" class="data-v-1f399f8a" bind:__l="__l"></tn-tabs></view></view></tn-nav-bar><view style="{{'padding-top:'+(vuex_custom_bar_height+'px')+';'}}" class="data-v-1f399f8a"><view data-event-opts="{{[['tap',[['e0',['$event']]]]]}}" class="tn-flex tn-flex-col-center tn-flex-row-between data-v-1f399f8a" style="padding:30rpx;" bindtap="__e"><view class="data-v-1f399f8a"><text class="data-v-1f399f8a">{{HomeTitle}}</text><text class="tn-icon-down-triangle data-v-1f399f8a"></text></view><view class="data-v-1f399f8a"><text class="data-v-1f399f8a">筛选</text></view></view></view><view class="tn-classify__container data-v-1f399f8a"><view class="tn-classify__container__wrap tn-flex tn-flex-nowrap tn-flex-row-around data-v-1f399f8a" style="height:100vh;background-color:#EBF4F7;"><scroll-view class="tn-classify__left-box left-width data-v-1f399f8a" scroll-y="{{true}}" scroll-with-animation="{{true}}"><block wx:for="{{$root.l0}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="{{['tn-classify__tabbar__item','tn-flex','tn-flex-col-center','data-v-1f399f8a',item.m0]}}" style="padding-left:20rpx;" id="{{'tabbar_item_'+index}}" data-event-opts="{{[['tap',[['clickClassifyNav',[index]]]]]}}" catchtap="__e"><view class="tn-classify__tabbar__item__title data-v-1f399f8a">{{item.$orig.industry_name}}</view></view></block></scroll-view><scroll-view class="tn-classify__right-box data-v-1f399f8a" scroll-y="{{true}}"><block class="data-v-1f399f8a"><view class="tn-classify__content data-v-1f399f8a"><view class="tn-classify__content__sub-classify__content data-v-1f399f8a"><block wx:for="{{list}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view class="data-v-1f399f8a"><view style="font-weight:300;background-color:#EBF4F7;color:#4AA2EF;width:100%;height:60rpx;line-height:60rpx;text-align:center;" class="data-v-1f399f8a">{{''+item.position_name+''}}</view><block wx:for="{{item.neirong}}" wx:for-item="v" wx:for-index="k"><block wx:if="{{item.neirong}}"><view data-event-opts="{{[['tap',[['tn',['/pages/index/my_card?id='+v.member_id]]]]]}}" class="tn-classify__content__sub-classify__content__item tn-flex tn-flex-center tn-flex-col-center data-v-1f399f8a" bindtap="__e"><view style="width:100rpx;height:100rpx;" class="data-v-1f399f8a"><image style="width:100rpx;height:100rpx;border-radius:50%;" src="{{apiImgUrl+v.photo_image}}" class="data-v-1f399f8a"></image></view><view style="margin-left:20rpx;" class="data-v-1f399f8a"><view style="font-size:28rpx;" class="data-v-1f399f8a"><text class="data-v-1f399f8a">{{v.nikename}}</text><text style="margin-left:50rpx;" class="data-v-1f399f8a">{{v.nation}}</text></view><view style="font-size:24rpx;margin-top:10rpx;" class="data-v-1f399f8a"><text class="data-v-1f399f8a">{{v.enterprise_Introduction}}</text></view></view></view></block></block><block wx:if="{{!item.neirong}}"><view style="text-align:center;padding:20rpx;" class="data-v-1f399f8a">暂无</view></block></view></block></view></view></block></scroll-view></view></view><tn-select vue-id="7cb8b842-3" mode="single" list="{{selectList}}" value="{{selectShow}}" data-event-opts="{{[['^confirm',[['confirm']]],['^input',[['__set_model',['','selectShow','$event',[]]]]]]}}" bind:confirm="__e" bind:input="__e" class="data-v-1f399f8a" bind:__l="__l"></tn-select></view>
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
.custom-nav.data-v-1f399f8a{height:100%}.custom-nav__back.data-v-1f399f8a{margin:auto 30rpx;margin-right:10rpx;flex-basis:5%;width:100rpx;position:absolute}.left-width.data-v-1f399f8a{flex-basis:42%}.tn-classify__right-box.data-v-1f399f8a{background-color:#fff}.tn-classify__tabbar__item.data-v-1f399f8a{height:90rpx}.tn-classify__tabbar__item.data-v-1f399f8a:first-child{border-top-right-radius:0rpx}.tn-classify__tabbar__item.data-v-1f399f8a:last-child{border-bottom-right-radius:0rpx}.tn-classify__tabbar__item--active.data-v-1f399f8a{background-color:#fff;position:relative;color:#4aa2ef}.tn-classify__tabbar__item--active--prev.data-v-1f399f8a{border-bottom-right-radius:26rpx}.tn-classify__tabbar__item--active--next.data-v-1f399f8a{border-top-right-radius:26rpx}.tn-classify__content.data-v-1f399f8a{margin:18rpx}.tn-classify__content__recomm.data-v-1f399f8a{margin-bottom:40rpx}.tn-classify__content__sub-classify.data-v-1f399f8a{margin-bottom:20rpx;padding-bottom:40rpx}.tn-classify__content__sub-classify--title.data-v-1f399f8a{font-weight:700;margin-bottom:18rpx}.tn-classify__content__sub-classify__content__item.data-v-1f399f8a{padding:20rpx}
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/discovery"],{3513:function(n,t,e){"use strict";(function(n){var o=e("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e("0c91"),a=o(e("de98")),r={data:function(){return{topCurrent:0,swiperList:[{url:"/static/banner1.jpg"}],list:[{name:"协会简介"},{name:"组织架构"},{name:"规章制度"},{name:"入会须知"}],current:0,cardCur:0,info:{},apiImgUrl:this.$store.state.imgUrl,architecture:[],userInfo:{}}},methods:{getUserInfo:function(){var t=this,e=n.getStorageSync("uid");e&&(0,i.getUserIndex)({member_id:e}).then((function(n){console.log(n),1==n.code&&(t.userInfo=n.data)})).catch((function(t){n.showToast({title:t,icon:"none",duration:2e3})}))},getArchitectureList:function(){var t=this;(0,i.architectureList)({association_id:a.default.state.Gid}).then((function(n){console.log(n),1==n.code&&(t.architecture=n.data)})).catch((function(t){n.showToast({title:t,icon:"none",duration:2e3})}))},getAssociationInfo:function(){var t=this;console.log("discovery"),(0,i.associationInfo)({association_id:a.default.state.Gid}).then((function(n){if(console.log(n),1==n.code){var e=n.data;-1!=e.association_desc.indexOf("<img")&&(e.association_desc=getApp().addWidthToImages(e.association_desc)),t.info=e}})).catch((function(t){n.showToast({title:t,icon:"none",duration:2e3})}))},getNewInfo:function(){this.getAssociationInfo(),this.getArchitectureList(),this.getUserInfo()},openUrl:function(t){var e=n.getStorageSync("uid");e?n.navigateTo({url:t}):n.showToast({title:"请登录!",icon:"none",duration:2e3})},openPages:function(t){n.navigateTo({url:t})},change:function(n){this.current=n}}};t.default=r}).call(this,e("543d")["default"])},4771:function(n,t,e){"use strict";e.r(t);var o=e("3513"),i=e.n(o);for(var a in o)["default"].indexOf(a)<0&&function(n){e.d(t,n,(function(){return o[n]}))}(a);t["default"]=i.a},"7a6c":function(n,t,e){"use strict";(function(n,t){var o=e("4ea4");e("34f1");o(e("66fd"));var i=o(e("7c76"));n.__webpack_require_UNI_MP_PLUGIN__=e,t(i.default)}).call(this,e("bc2e")["default"],e("543d")["createPage"])},"7c76":function(n,t,e){"use strict";e.r(t);var o=e("a95b"),i=e("4771");for(var a in i)["default"].indexOf(a)<0&&function(n){e.d(t,n,(function(){return i[n]}))}(a);var r=e("f0c5"),c=Object(r["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);t["default"]=c.exports},a95b:function(n,t,e){"use strict";e.d(t,"b",(function(){return i})),e.d(t,"c",(function(){return a})),e.d(t,"a",(function(){return o}));var o={tnNavBar:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-nav-bar/tn-nav-bar")]).then(e.bind(null,"5d27"))},tnTabs:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-tabs/tn-tabs")]).then(e.bind(null,"8772"))},tnButton:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-button/tn-button")]).then(e.bind(null,"f566"))},tnGrid:function(){return e.e("tuniao-ui/components/tn-grid/tn-grid").then(e.bind(null,"8392"))},tnGridItem:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-grid-item/tn-grid-item")]).then(e.bind(null,"3309"))}},i=function(){var n=this.$createElement;this._self._c;this.$mp.data=Object.assign({},{$root:{a0:{fontWeight:"600",fontSize:"30rpx"},a1:{background:"linear-gradient(-45deg, #4AA2EF, #3A7FF4)",borderRadius:"4rpx"}}})},a=[]}},[["7a6c","common/runtime","common/vendor"]]]);
 | 
			
		||||
@ -1,11 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "navigationBarTitleText": "智慧云商协",
 | 
			
		||||
  "enablePullDownRefresh": false,
 | 
			
		||||
  "usingComponents": {
 | 
			
		||||
    "tn-nav-bar": "/tuniao-ui/components/tn-nav-bar/tn-nav-bar",
 | 
			
		||||
    "tn-tabs": "/tuniao-ui/components/tn-tabs/tn-tabs",
 | 
			
		||||
    "tn-button": "/tuniao-ui/components/tn-button/tn-button",
 | 
			
		||||
    "tn-grid": "/tuniao-ui/components/tn-grid/tn-grid",
 | 
			
		||||
    "tn-grid-item": "/tuniao-ui/components/tn-grid-item/tn-grid-item"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/enter_in"],{"08f3":function(n,t,e){"use strict";e.d(t,"b",(function(){return u})),e.d(t,"c",(function(){return a})),e.d(t,"a",(function(){return o}));var o={tnNavBar:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-nav-bar/tn-nav-bar")]).then(e.bind(null,"5d27"))},tnTabs:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-tabs/tn-tabs")]).then(e.bind(null,"8772"))},tnImageUploadDrag:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-image-upload-drag/tn-image-upload-drag")]).then(e.bind(null,"1096"))},tnButton:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-button/tn-button")]).then(e.bind(null,"f566"))}},u=function(){var n=this.$createElement;this._self._c},a=[]},"174e":function(n,t,e){"use strict";e.r(t);var o=e("08f3"),u=e("3f7c");for(var a in u)["default"].indexOf(a)<0&&function(n){e.d(t,n,(function(){return u[n]}))}(a);e("e447");var r=e("f0c5"),i=Object(r["a"])(u["default"],o["b"],o["c"],!1,null,"62443c50",null,!1,o["a"],void 0);t["default"]=i.exports},"3f7c":function(n,t,e){"use strict";e.r(t);var o=e("6e9e"),u=e.n(o);for(var a in o)["default"].indexOf(a)<0&&function(n){e.d(t,n,(function(){return o[n]}))}(a);t["default"]=u.a},"6e9e":function(n,t,e){"use strict";(function(n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={data:function(){return{topCurrent:0}},onLoad:function(){},methods:{tn:function(t){n.navigateTo({url:t})},goBack:function(){getCurrentPages().length>1?n.navigateBack():n.redirectTo({url:"/pages/index/index"})}}};t.default=e}).call(this,e("543d")["default"])},"82be":function(n,t,e){},cc57:function(n,t,e){"use strict";(function(n,t){var o=e("4ea4");e("34f1");o(e("66fd"));var u=o(e("174e"));n.__webpack_require_UNI_MP_PLUGIN__=e,t(u.default)}).call(this,e("bc2e")["default"],e("543d")["createPage"])},e447:function(n,t,e){"use strict";var o=e("82be"),u=e.n(o);u.a}},[["cc57","common/runtime","common/vendor"]]]);
 | 
			
		||||
@ -1,10 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "navigationBarTitleText": "智慧云商协",
 | 
			
		||||
  "enablePullDownRefresh": false,
 | 
			
		||||
  "usingComponents": {
 | 
			
		||||
    "tn-nav-bar": "/tuniao-ui/components/tn-nav-bar/tn-nav-bar",
 | 
			
		||||
    "tn-tabs": "/tuniao-ui/components/tn-tabs/tn-tabs",
 | 
			
		||||
    "tn-image-upload-drag": "/tuniao-ui/components/tn-image-upload-drag/tn-image-upload-drag",
 | 
			
		||||
    "tn-button": "/tuniao-ui/components/tn-button/tn-button"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
<view class="template-edit tn-safe-area-inset-bottom data-v-62443c50"><tn-nav-bar vue-id="24f2b6f8-1" isBack="{{false}}" backTitle bottomShadow="{{true}}" backgroundColor="#FFFFFF" class="data-v-62443c50" bind:__l="__l" vue-slots="{{['default']}}"><view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left data-v-62443c50"><view data-event-opts="{{[['tap',[['goBack']]]]}}" style="padding-left:15rpx;" bindtap="__e" class="data-v-62443c50"><text class="tn-icon-left data-v-62443c50" style="font-size:40rpx;"></text></view><view class="tn-margin-top data-v-62443c50" style="text-shadow:1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;"><tn-tabs vue-id="{{('24f2b6f8-2')+','+('24f2b6f8-1')}}" list="{{[{name:'协会入驻'}]}}" current="{{topCurrent}}" activeColor="#000" bold="{{false}}" fontSize="{{36}}" class="data-v-62443c50" bind:__l="__l"></tn-tabs></view></view></tn-nav-bar><view class="tn-safe-area-inset-bottom data-v-62443c50" style="{{'padding-top:'+(vuex_custom_bar_height+'px')+';'}}"><view class="tn-flex tn-flex-row-between tn-flex-col-center tn-margin data-v-62443c50"><view class="data-v-62443c50"><view class="data-v-62443c50"><text class="tn-text-lg tn-padding-right-xs tn-text-bold data-v-62443c50">协会头像</text></view></view><view style="width:100rpx;height:100rpx;margin-right:30rpx;" class="data-v-62443c50"><tn-image-upload-drag vue-id="24f2b6f8-3" width="{{150}}" height="{{150}}" data-ref="imageUpload" class="data-v-62443c50 vue-ref" bind:__l="__l"></tn-image-upload-drag></view></view><view class="tn-flex tn-flex-row-between tn-flex-col-center tn-padding-top tn-margin data-v-62443c50"><view class="tn-flex justify-content-item data-v-62443c50"><view class="tn-text-lg tn-padding-right-xs tn-text-bold data-v-62443c50">协会名称</view></view></view><view class="tn-margin tn-bg-gray--light data-v-62443c50" style="border-radius:10rpx;padding:20rpx 30rpx;"><input placeholder="填写协会名称" name="input" placeholder-style="color:#AAAAAA" class="data-v-62443c50"/></view><view class="tn-flex tn-flex-row-between tn-flex-col-center tn-padding-top tn-margin data-v-62443c50"><view class="tn-flex justify-content-item data-v-62443c50"><view class="tn-text-lg tn-padding-right-xs tn-text-bold data-v-62443c50">联系方式</view></view></view><view class="tn-margin tn-bg-gray--light data-v-62443c50" style="border-radius:10rpx;padding:20rpx 30rpx;"><input placeholder="填写联系方式" name="input" placeholder-style="color:#AAAAAA" class="data-v-62443c50"/></view><view class="tn-flex tn-flex-row-between tn-flex-col-center tn-padding-top tn-margin data-v-62443c50"><view class="tn-flex justify-content-item data-v-62443c50"><view class="tn-text-lg tn-padding-right-xs tn-text-bold data-v-62443c50">协会地址</view></view></view><view class="tn-margin tn-bg-gray--light data-v-62443c50" style="border-radius:10rpx;padding:20rpx 30rpx;"><input placeholder="填写协会地址" name="input" placeholder-style="color:#AAAAAA" class="data-v-62443c50"/></view><view class="tn-flex tn-flex-row-between tn-flex-col-center tn-padding-top tn-margin data-v-62443c50"><view class="tn-flex justify-content-item data-v-62443c50"><view class="tn-text-lg tn-padding-right-xs tn-text-bold data-v-62443c50">协会简介</view></view></view><view class="tn-margin tn-bg-gray--light tn-padding data-v-62443c50" style="border-radius:10rpx;"><textarea maxlength="500" placeholder="填写协会简介" placeholder-style="color:#AAAAAA" class="data-v-62443c50"></textarea></view><view class="tn-flex tn-footerfixed data-v-62443c50"><view class="tn-flex-1 justify-content-item tn-margin-sm tn-text-center data-v-62443c50"><tn-button vue-id="24f2b6f8-4" backgroundColor="#FBBD12" fontColor="#ffffff" padding="40rpx 0" width="60%" shadow="{{true}}" fontBold="{{true}}" data-event-opts="{{[['^tap',[['upload']]]]}}" bind:tap="__e" class="data-v-62443c50" bind:__l="__l" vue-slots="{{['default']}}"><text class="data-v-62443c50">提 交 申 请</text></tn-button></view></view></view><view class="tn-tabbar-height data-v-62443c50"></view></view>
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
.tn-tabbar-height.data-v-62443c50{min-height:100rpx;height:calc(120rpx + env(safe-area-inset-bottom) / 2)}.tn-footerfixed.data-v-62443c50{position:fixed;width:100%;bottom:calc(30rpx + env(safe-area-inset-bottom));z-index:1024;box-shadow:0 1rpx 6rpx transparent}.tn-tag-content__item.data-v-62443c50{display:inline-block;line-height:45rpx;padding:10rpx 30rpx;margin:20rpx 20rpx 5rpx 0rpx}.tn-tag-content__item--prefix.data-v-62443c50{padding-right:10rpx}
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/event_info"],{"0719":function(t,n,e){"use strict";(function(t,n){var o=e("4ea4");e("34f1");o(e("66fd"));var i=o(e("b11c"));t.__webpack_require_UNI_MP_PLUGIN__=e,n(i.default)}).call(this,e("bc2e")["default"],e("543d")["createPage"])},"8c0d":function(t,n,e){"use strict";e.d(n,"b",(function(){return i})),e.d(n,"c",(function(){return a})),e.d(n,"a",(function(){return o}));var o={tnNavBar:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-nav-bar/tn-nav-bar")]).then(e.bind(null,"5d27"))},tnTabs:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-tabs/tn-tabs")]).then(e.bind(null,"8772"))},tnButton:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-button/tn-button")]).then(e.bind(null,"f566"))}},i=function(){var t=this.$createElement;this._self._c},a=[]},b11c:function(t,n,e){"use strict";e.r(n);var o=e("8c0d"),i=e("eb09");for(var a in i)["default"].indexOf(a)<0&&function(t){e.d(n,t,(function(){return i[t]}))}(a);var c=e("f0c5"),u=Object(c["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);n["default"]=u.exports},e49d:function(t,n,e){"use strict";(function(t){var o=e("4ea4");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=e("0c91"),a=o(e("de98")),c={data:function(){return{topCurrent:0,id:0,info:{},apiImgUrl:this.$store.state.imgUrl}},mounted:function(){},onLoad:function(t){console.log(t),this.id=t.id,this.getEventInfo()},methods:{application_add:function(){var n=t.getStorageSync("uid");n?(0,i.applicationAdd)({association_id:a.default.state.Gid,member_id:n,activity_id:this.id,application_time:(new Date).toISOString().slice(0,19).replace("T"," ")}).then((function(n){1==n.code?t.showToast({title:"报名成功!",icon:"none",duration:2e3}):t.showToast({title:n.msg,icon:"none",duration:2e3})})).catch((function(n){t.showToast({title:n,icon:"none",duration:2e3})})):t.showToast({title:"请登录后报名!",icon:"none",duration:2e3})},getEventInfo:function(){var n=this;(0,i.eventInfo)({association_id:a.default.state.Gid,id:this.id}).then((function(t){if(console.log(t),1==t.code){var e=t.data;-1!=e.activity_content.indexOf("<img")&&(e.activity_content=getApp().addWidthToImages(e.activity_content)),n.info=e}})).catch((function(n){t.showToast({title:n,icon:"none",duration:2e3})}))},goBack:function(){getCurrentPages().length>1?t.navigateBack():t.redirectTo({url:"/pages/index/index"})}}};n.default=c}).call(this,e("543d")["default"])},eb09:function(t,n,e){"use strict";e.r(n);var o=e("e49d"),i=e.n(o);for(var a in o)["default"].indexOf(a)<0&&function(t){e.d(n,t,(function(){return o[t]}))}(a);n["default"]=i.a}},[["0719","common/runtime","common/vendor"]]]);
 | 
			
		||||
@ -1,9 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "navigationBarTitleText": "智慧云商协",
 | 
			
		||||
  "enablePullDownRefresh": false,
 | 
			
		||||
  "usingComponents": {
 | 
			
		||||
    "tn-nav-bar": "/tuniao-ui/components/tn-nav-bar/tn-nav-bar",
 | 
			
		||||
    "tn-tabs": "/tuniao-ui/components/tn-tabs/tn-tabs",
 | 
			
		||||
    "tn-button": "/tuniao-ui/components/tn-button/tn-button"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
<view style="letter-spacing:1rpx;"><tn-nav-bar vue-id="a93e3dc6-1" isBack="{{false}}" backTitle bottomShadow="{{true}}" backgroundColor="#FFFFFF" bind:__l="__l" vue-slots="{{['default']}}"><view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-between"><view class="tn-flex tn-flex-col-center tn-flex-row-left"><view data-event-opts="{{[['tap',[['goBack']]]]}}" style="padding-left:15rpx;" bindtap="__e"><text class="tn-icon-left" style="font-size:40rpx;"></text></view><view class="tn-margin-top" style="text-shadow:1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;"><tn-tabs vue-id="{{('a93e3dc6-2')+','+('a93e3dc6-1')}}" list="{{[{name:'活动详情'}]}}" current="{{topCurrent}}" activeColor="#000" bold="{{false}}" fontSize="{{36}}" bind:__l="__l"></tn-tabs></view></view></view></tn-nav-bar><view style="{{'padding-top:'+(vuex_custom_bar_height+'px')+';'}}"><image style="width:100%;" src="{{apiImgUrl+info.activity_image}}" mode="widthFix"></image><view style="padding:20rpx 30rpx;"><view style="font-size:30rpx;font-weight:600;">{{info.activity_name}}</view><view style="margin-top:40rpx;"><view><text style="color:#26BB71;">●</text><text style="margin-left:10rpx;font-weight:600;">开始时间:</text><text style="color:#979797;">{{info.activity_start_time}}</text></view><view style="margin:15rpx 0rpx;"><text style="color:#BE7E28;">●</text><text style="margin-left:10rpx;font-weight:600;">结束时间:</text><text style="color:#979797;">{{info.activity_end_time}}</text></view><view><text style="color:#DB5022;">●</text><text style="margin-left:10rpx;font-weight:600;">活动地点:</text><text style="color:#979797;">{{info.activity_location}}</text></view></view><view style="margin-top:60rpx;font-size:32rpx;font-weight:600;">活动介绍</view><view><view class="ks_html" style="line-height:50rpx;margin-top:20rpx;padding-bottom:180rpx;"><view class="_div"><rich-text nodes="{{info.activity_content}}"></rich-text></view></view></view></view></view><view style="position:fixed;bottom:30rpx;background-color:#ffffff;padding:30rpx;width:100%;"><view style="text-align:center;margin-top:30rpx;"><block wx:if="{{info.type=='未开始'}}"><tn-button vue-id="a93e3dc6-3" backgroundColor="#F73909" height="80rpx" width="100%" fontColor="#ffffff" shape="round" data-event-opts="{{[['^click',[['application_add']]]]}}" bind:click="__e" bind:__l="__l" vue-slots="{{['default']}}">报名</tn-button></block><block wx:if="{{info.type=='已结束'||info.type=='进行中'}}"><tn-button vue-id="a93e3dc6-4" disabled="{{true}}" backgroundColor="#E6E6E6" height="80rpx" width="100%" fontColor="#ffffff" shape="round" bind:__l="__l" vue-slots="{{['default']}}">报名已结束</tn-button></block></view></view></view>
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/events_list"],{7916:function(n,t,e){"use strict";e.r(t);var u=e("b901"),o=e("a21d");for(var a in o)["default"].indexOf(a)<0&&function(n){e.d(t,n,(function(){return o[n]}))}(a);var r=e("f0c5"),i=Object(r["a"])(o["default"],u["b"],u["c"],!1,null,null,null,!1,u["a"],void 0);t["default"]=i.exports},"99ab":function(n,t,e){"use strict";(function(n,t){var u=e("4ea4");e("34f1");u(e("66fd"));var o=u(e("7916"));n.__webpack_require_UNI_MP_PLUGIN__=e,t(o.default)}).call(this,e("bc2e")["default"],e("543d")["createPage"])},a21d:function(n,t,e){"use strict";e.r(t);var u=e("e591"),o=e.n(u);for(var a in u)["default"].indexOf(a)<0&&function(n){e.d(t,n,(function(){return u[n]}))}(a);t["default"]=o.a},b901:function(n,t,e){"use strict";e.d(t,"b",(function(){return o})),e.d(t,"c",(function(){return a})),e.d(t,"a",(function(){return u}));var u={tnNavBar:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-nav-bar/tn-nav-bar")]).then(e.bind(null,"5d27"))},tnTabs:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-tabs/tn-tabs")]).then(e.bind(null,"8772"))},tnButton:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-button/tn-button")]).then(e.bind(null,"f566"))}},o=function(){var n=this.$createElement;this._self._c},a=[]},e591:function(n,t,e){"use strict";(function(n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={data:function(){return{topCurrent:0}},methods:{openUrl:function(t){n.navigateTo({url:t})},goBack:function(){getCurrentPages().length>1?n.navigateBack():n.redirectTo({url:"/pages/index/index"})}}};t.default=e}).call(this,e("543d")["default"])}},[["99ab","common/runtime","common/vendor"]]]);
 | 
			
		||||
@ -1,9 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "navigationBarTitleText": "智慧云商协",
 | 
			
		||||
  "enablePullDownRefresh": false,
 | 
			
		||||
  "usingComponents": {
 | 
			
		||||
    "tn-nav-bar": "/tuniao-ui/components/tn-nav-bar/tn-nav-bar",
 | 
			
		||||
    "tn-tabs": "/tuniao-ui/components/tn-tabs/tn-tabs",
 | 
			
		||||
    "tn-button": "/tuniao-ui/components/tn-button/tn-button"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
<view style="background-color:#EBF4F7;letter-spacing:1rpx;"><tn-nav-bar vue-id="2ddca128-1" isBack="{{false}}" backTitle bottomShadow="{{true}}" backgroundColor="#FFFFFF" bind:__l="__l" vue-slots="{{['default']}}"><view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left"><view data-event-opts="{{[['tap',[['goBack']]]]}}" style="padding-left:15rpx;" bindtap="__e"><text class="tn-icon-left" style="font-size:40rpx;"></text></view><view class="tn-margin-top" style="text-shadow:1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;"><tn-tabs vue-id="{{('2ddca128-2')+','+('2ddca128-1')}}" list="{{[{name:'协会活动'}]}}" current="{{topCurrent}}" activeColor="#000" bold="{{false}}" fontSize="{{36}}" bind:__l="__l"></tn-tabs></view></view></tn-nav-bar><view style="{{'padding-top:'+(vuex_custom_bar_height+'px')+';'}}"><view style="padding:10px 30rpx;"><block wx:for="{{list}}" wx:for-item="item" wx:for-index="index"><view data-event-opts="{{[['tap',[['openUrl',['/pages/index/events_info']]]]]}}" class="tn-flex tn-flex-row-between" style="background-color:#ffffff;padding:20rpx;border-radius:10rpx;margin-bottom:10rpx;" bindtap="__e"><view style="position:relative;"><view style="font-size:28rpx;">青年企业家能力提升 计划培训班(第20期)</view><view class="tn-flex tn-flex-row-between" style="position:absolute;bottom:0rpx;width:100%;color:#808080;"><view>2023-12-25</view><view><block wx:if="{{index%2==0&&index!=2}}"><tn-button vue-id="{{'2ddca128-3-'+index}}" padding="0px" width="100rpx" height="40rpx" size="sm" backgroundColor="#6BC7F0 " fontColor="tn-color-white" bind:__l="__l" vue-slots="{{['default']}}">报名中</tn-button></block><block wx:if="{{index%2==1&&index!=2}}"><tn-button vue-id="{{'2ddca128-4-'+index}}" padding="0px" width="100rpx" height="40rpx" size="sm" backgroundColor="#EE9556 " fontColor="tn-color-white" bind:__l="__l" vue-slots="{{['default']}}">预告</tn-button></block><block wx:if="{{index==2}}"><tn-button vue-id="{{'2ddca128-5-'+index}}" padding="0px" width="100rpx" height="40rpx" size="sm" backgroundColor="#E12B33 " fontColor="tn-color-white" bind:__l="__l" vue-slots="{{['default']}}">进行中</tn-button></block></view></view></view><view style="margin-left:20rpx;"><image style="width:200rpx;height:135rpx;border-radius:10rpx;" src="/static/hd1.jpg"></image></view></view></block></view></view></view>
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/events_my"],{"2f69":function(n,t,e){"use strict";e.r(t);var o=e("d685"),i=e("bf20");for(var a in i)["default"].indexOf(a)<0&&function(n){e.d(t,n,(function(){return i[n]}))}(a);var r=e("f0c5"),u=Object(r["a"])(i["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);t["default"]=u.exports},4386:function(n,t,e){"use strict";(function(n){var o=e("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=e("0c91"),a=(o(e("de98")),{data:function(){return{topCurrent:0,list:[],apiImgUrl:this.$store.state.imgUrl}},onLoad:function(){var t=n.getStorageSync("uid");this.uid=t,this.getUserApplication()},methods:{getUserApplication:function(){var t=this;(0,i.UserApplication)({member_id:2}).then((function(n){console.log(n),1==n.code&&(t.list=n.data)})).catch((function(t){n.showToast({title:t,icon:"none",duration:2e3})}))},openUrl:function(t){n.navigateTo({url:t})},goBack:function(){getCurrentPages().length>1?n.navigateBack():n.redirectTo({url:"/pages/index/index"})}}});t.default=a}).call(this,e("543d")["default"])},b181:function(n,t,e){"use strict";(function(n,t){var o=e("4ea4");e("34f1");o(e("66fd"));var i=o(e("2f69"));n.__webpack_require_UNI_MP_PLUGIN__=e,t(i.default)}).call(this,e("bc2e")["default"],e("543d")["createPage"])},bf20:function(n,t,e){"use strict";e.r(t);var o=e("4386"),i=e.n(o);for(var a in o)["default"].indexOf(a)<0&&function(n){e.d(t,n,(function(){return o[n]}))}(a);t["default"]=i.a},d685:function(n,t,e){"use strict";e.d(t,"b",(function(){return i})),e.d(t,"c",(function(){return a})),e.d(t,"a",(function(){return o}));var o={tnNavBar:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-nav-bar/tn-nav-bar")]).then(e.bind(null,"5d27"))},tnTabs:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-tabs/tn-tabs")]).then(e.bind(null,"8772"))},tnButton:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-button/tn-button")]).then(e.bind(null,"f566"))}},i=function(){var n=this.$createElement;this._self._c},a=[]}},[["b181","common/runtime","common/vendor"]]]);
 | 
			
		||||
@ -1,9 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "navigationBarTitleText": "智慧云商协",
 | 
			
		||||
  "enablePullDownRefresh": false,
 | 
			
		||||
  "usingComponents": {
 | 
			
		||||
    "tn-nav-bar": "/tuniao-ui/components/tn-nav-bar/tn-nav-bar",
 | 
			
		||||
    "tn-tabs": "/tuniao-ui/components/tn-tabs/tn-tabs",
 | 
			
		||||
    "tn-button": "/tuniao-ui/components/tn-button/tn-button"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
<view style="letter-spacing:1rpx;"><tn-nav-bar vue-id="93907a4c-1" isBack="{{false}}" backTitle bottomShadow="{{true}}" backgroundColor="#FFFFFF" bind:__l="__l" vue-slots="{{['default']}}"><view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left"><view data-event-opts="{{[['tap',[['goBack']]]]}}" style="padding-left:15rpx;" bindtap="__e"><text class="tn-icon-left" style="font-size:40rpx;"></text></view><view class="tn-margin-top" style="text-shadow:1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;"><tn-tabs vue-id="{{('93907a4c-2')+','+('93907a4c-1')}}" list="{{[{name:'我参与的活动'}]}}" current="{{topCurrent}}" activeColor="#000" bold="{{false}}" fontSize="{{36}}" bind:__l="__l"></tn-tabs></view></view></tn-nav-bar><view style="{{'padding-top:'+(vuex_custom_bar_height+'px')+';'}}"><view style="padding:10px 30rpx;"><block wx:for="{{list}}" wx:for-item="item" wx:for-index="index"><view data-event-opts="{{[['tap',[['openUrl',['/pages/index/event_info?id='+item.activity_id]]]]]}}" class="tn-flex tn-flex-row-between" style="background-color:#ffffff;padding:20rpx;border-radius:10rpx;margin-bottom:30rpx;box-shadow:rgba(12, 0, 5, 0.1) 0px 0px 5px 0px;" bindtap="__e"><view style="position:relative;"><view style="font-size:28rpx;">{{item.activity_name}}</view><view class="tn-flex tn-flex-row-between" style="position:absolute;bottom:0rpx;width:420rpx;color:#808080;"><view>{{item.activity_start_time}}</view><view style="margin-left:10rpx;"><block wx:if="{{item.type=='未开始'}}"><tn-button vue-id="{{'93907a4c-3-'+index}}" padding="0px" width="100rpx" height="40rpx" size="sm" backgroundColor="#6BC7F0 " fontColor="tn-color-white" bind:__l="__l" vue-slots="{{['default']}}">未开始</tn-button></block><block wx:if="{{item.type=='进行中'}}"><tn-button vue-id="{{'93907a4c-4-'+index}}" padding="0px" width="100rpx" height="40rpx" size="sm" backgroundColor="#EE9556 " fontColor="tn-color-white" bind:__l="__l" vue-slots="{{['default']}}">进行中</tn-button></block><block wx:if="{{item.type=='已结束'}}"><tn-button vue-id="{{'93907a4c-5-'+index}}" padding="0px" width="100rpx" height="40rpx" size="sm" backgroundColor="#E12B33 " fontColor="tn-color-white" bind:__l="__l" vue-slots="{{['default']}}">已结束</tn-button></block></view></view></view><view style="margin-left:20rpx;"><image style="width:200rpx;height:135rpx;border-radius:10rpx;" src="{{apiImgUrl+item.activity_image}}"></image></view></view></block></view></view></view>
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/goods_info"],{"0888":function(n,t,e){"use strict";(function(n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={data:function(){return{topCurrent:0}},methods:{goBack:function(){getCurrentPages().length>1?n.navigateBack():n.redirectTo({url:"/pages/index/index"})}}};t.default=e}).call(this,e("543d")["default"])},8782:function(n,t,e){"use strict";e.r(t);var a=e("f0c2"),o=e("8b3d");for(var u in o)["default"].indexOf(u)<0&&function(n){e.d(t,n,(function(){return o[n]}))}(u);var r=e("f0c5"),i=Object(r["a"])(o["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],void 0);t["default"]=i.exports},"8b3d":function(n,t,e){"use strict";e.r(t);var a=e("0888"),o=e.n(a);for(var u in a)["default"].indexOf(u)<0&&function(n){e.d(t,n,(function(){return a[n]}))}(u);t["default"]=o.a},a34c:function(n,t,e){"use strict";(function(n,t){var a=e("4ea4");e("34f1");a(e("66fd"));var o=a(e("8782"));n.__webpack_require_UNI_MP_PLUGIN__=e,t(o.default)}).call(this,e("bc2e")["default"],e("543d")["createPage"])},f0c2:function(n,t,e){"use strict";e.d(t,"b",(function(){return o})),e.d(t,"c",(function(){return u})),e.d(t,"a",(function(){return a}));var a={tnNavBar:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-nav-bar/tn-nav-bar")]).then(e.bind(null,"5d27"))},tnTabs:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-tabs/tn-tabs")]).then(e.bind(null,"8772"))},tnTag:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-tag/tn-tag")]).then(e.bind(null,"3023"))}},o=function(){var n=this.$createElement;this._self._c},u=[]}},[["a34c","common/runtime","common/vendor"]]]);
 | 
			
		||||
@ -1,9 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "navigationBarTitleText": "智慧云商协",
 | 
			
		||||
  "enablePullDownRefresh": false,
 | 
			
		||||
  "usingComponents": {
 | 
			
		||||
    "tn-nav-bar": "/tuniao-ui/components/tn-nav-bar/tn-nav-bar",
 | 
			
		||||
    "tn-tabs": "/tuniao-ui/components/tn-tabs/tn-tabs",
 | 
			
		||||
    "tn-tag": "/tuniao-ui/components/tn-tag/tn-tag"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,4 +0,0 @@
 | 
			
		||||
<view style="letter-spacing:1rpx;"><tn-nav-bar vue-id="bd5f6a4e-1" isBack="{{false}}" backTitle bottomShadow="{{true}}" backgroundColor="#FFFFFF" bind:__l="__l" vue-slots="{{['default']}}"><view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left"><view data-event-opts="{{[['tap',[['goBack']]]]}}" style="padding-left:15rpx;" bindtap="__e"><text class="tn-icon-left" style="font-size:40rpx;"></text></view><view class="tn-margin-top" style="text-shadow:1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;"><tn-tabs vue-id="{{('bd5f6a4e-2')+','+('bd5f6a4e-1')}}" list="{{[{name:'供需服务'}]}}" current="{{topCurrent}}" activeColor="#000" bold="{{false}}" fontSize="{{36}}" bind:__l="__l"></tn-tabs></view></view></tn-nav-bar><view style="{{'padding-top:'+(vuex_custom_bar_height+'px')+';'}}"><view style="padding:30rpx;"><view style="text-align:center;font-size:40rpx;font-weight:600;">劲捷飞燕系列P056C旅拍三脚架碳纤维摄影</view><view style="margin-top:30rpx;color:#999;"><text>时间:2023-12-25</text><text style="margin-left:20rpx;">来源:洛阳灵睿网络技术有限公司</text></view><view><tn-tag vue-id="bd5f6a4e-3" shape="radius" width="auto" backgroundColor="#F7F7F7" fontColor="#808080" bind:__l="__l" vue-slots="{{['default']}}">洛阳市</tn-tag><tn-tag vue-id="bd5f6a4e-4" shape="radius" margin="20rpx" width="auto" backgroundColor="#EBF4F7" fontColor="#3377FF" bind:__l="__l" vue-slots="{{['default']}}">合作意向18人</tn-tag><tn-tag vue-id="bd5f6a4e-5" shape="radius" width="auto" backgroundColor="#F7F3EB" fontColor="#FF8C19" bind:__l="__l" vue-slots="{{['default']}}">项目金额1万以下</tn-tag></view><view style="width:100%;height:2rpx;background-color:#eee;margin-top:0rpx;"></view><view style="padding-bottom:200rpx;"><view style="margin-top:20rpx;position:relative;"><image style="width:100rpx;height:100rpx;position:absolute;left:0;right:0;top:38%;z-index:10;margin:0 auto;" src="/static/b1.png"></image><image style="width:100%;border-radius:20rpx;" src="/static/t7.jpg" mode="widthFix"></image></view><view style="line-height:50rpx;text-indent:2em;margin-top:20rpx;"><view class="_p">河南省青年企业家协会(HeNan Young
 | 
			
		||||
						Entrepreneurs’Association),简称为省青企协,是全省性的青年企业家的群众组织,是共青团联系青年企业家的桥梁和纽带,是具有独立法人资格的非营利性社会团体,是中国青年企业家协会、河南省青年联合会、河南省企业联合会(河南省企业家协会)的团体会员。</view><view class="_p">河南省青年企业家协会(HeNan Young
 | 
			
		||||
						Entrepreneurs’Association),简称为省青企协,是全省性的青年企业家的群众组织,是共青团联系青年企业家的桥梁和纽带,是具有独立法人资格的非营利性社会团体,是中国青年企业家协会、河南省青年联合会、河南省企业联合会(河南省企业家协会)的团体会员。</view><view class="_p">河南省青年企业家协会(HeNan Young
 | 
			
		||||
						Entrepreneurs’Association),简称为省青企协,是全省性的青年企业家的群众组织,是共青团联系青年企业家的桥梁和纽带,是具有独立法人资格的非营利性社会团体,是中国青年企业家协会、河南省青年联合会、河南省企业联合会(河南省企业家协会)的团体会员。</view></view></view></view></view><view style="position:fixed;bottom:5%;width:100%;"><view class="tn-flex tn-flex-row-around"><view style="color:#fff;letter-spacing:10rpx;line-height:70rpx;text-align:center;width:400rpx;height:70rpx;background:linear-gradient(270deg, #EE7E45, #EE9657);border-radius:50rpx;">联系TA</view></view></view></view>
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/goods_list"],{"0b53":function(n,t,e){"use strict";e.d(t,"b",(function(){return r})),e.d(t,"c",(function(){return a})),e.d(t,"a",(function(){return o}));var o={tnNavBar:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-nav-bar/tn-nav-bar")]).then(e.bind(null,"5d27"))},tnTabs:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-tabs/tn-tabs")]).then(e.bind(null,"8772"))},tnTag:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-tag/tn-tag")]).then(e.bind(null,"3023"))},tnButton:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-button/tn-button")]).then(e.bind(null,"f566"))}},r=function(){var n=this.$createElement;this._self._c;this.$mp.data=Object.assign({},{$root:{a0:{fontWeight:"600",fontSize:"30rpx"},a1:{background:"linear-gradient(-45deg, #4AA2EF, #3A7FF4)",borderRadius:"4rpx"}}})},a=[]},5307:function(n,t,e){"use strict";(function(n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={data:function(){return{topCurrent:0,list:[{name:"供应"},{name:"需求"}],current:0}},methods:{openUrl:function(t){n.navigateTo({url:t})},change:function(n){this.current=n},goBack:function(){getCurrentPages().length>1?n.navigateBack():n.redirectTo({url:"/pages/index/index"})}}};t.default=e}).call(this,e("543d")["default"])},"93cd":function(n,t,e){"use strict";e.r(t);var o=e("5307"),r=e.n(o);for(var a in o)["default"].indexOf(a)<0&&function(n){e.d(t,n,(function(){return o[n]}))}(a);t["default"]=r.a},c428:function(n,t,e){"use strict";e.r(t);var o=e("0b53"),r=e("93cd");for(var a in r)["default"].indexOf(a)<0&&function(n){e.d(t,n,(function(){return r[n]}))}(a);var u=e("f0c5"),i=Object(u["a"])(r["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);t["default"]=i.exports},e564:function(n,t,e){"use strict";(function(n,t){var o=e("4ea4");e("34f1");o(e("66fd"));var r=o(e("c428"));n.__webpack_require_UNI_MP_PLUGIN__=e,t(r.default)}).call(this,e("bc2e")["default"],e("543d")["createPage"])}},[["e564","common/runtime","common/vendor"]]]);
 | 
			
		||||
@ -1,10 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "navigationBarTitleText": "智慧云商协",
 | 
			
		||||
  "enablePullDownRefresh": false,
 | 
			
		||||
  "usingComponents": {
 | 
			
		||||
    "tn-nav-bar": "/tuniao-ui/components/tn-nav-bar/tn-nav-bar",
 | 
			
		||||
    "tn-tabs": "/tuniao-ui/components/tn-tabs/tn-tabs",
 | 
			
		||||
    "tn-tag": "/tuniao-ui/components/tn-tag/tn-tag",
 | 
			
		||||
    "tn-button": "/tuniao-ui/components/tn-button/tn-button"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
<view style="background-color:#EBF4F7;letter-spacing:1rpx;"><tn-nav-bar vue-id="0ef0f4e9-1" isBack="{{false}}" backTitle bottomShadow="{{true}}" backgroundColor="#FFFFFF" bind:__l="__l" vue-slots="{{['default']}}"><view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left"><view data-event-opts="{{[['tap',[['goBack']]]]}}" style="padding-left:15rpx;" bindtap="__e"><text class="tn-icon-left" style="font-size:40rpx;"></text></view><view class="tn-margin-top" style="text-shadow:1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;"><tn-tabs vue-id="{{('0ef0f4e9-2')+','+('0ef0f4e9-1')}}" list="{{[{name:'供需服务'}]}}" current="{{topCurrent}}" activeColor="#000" bold="{{false}}" fontSize="{{36}}" bind:__l="__l"></tn-tabs></view></view></tn-nav-bar><view style="{{'padding-top:'+(vuex_custom_bar_height+'px')+';'}}"><view style="background-color:#FFFFFF;"><tn-tabs vue-id="0ef0f4e9-3" list="{{list}}" isScroll="{{false}}" activeItemStyle="{{$root.a0}}" activeColor="#000" barWidth="{{50}}" barHeight="{{6}}" backgroundColor="#FFFFFF" barStyle="{{$root.a1}}" current="{{current}}" name="name" data-event-opts="{{[['^change',[['change']]]]}}" bind:change="__e" bind:__l="__l"></tn-tabs></view><view style="padding:30rpx;"><block wx:for="{{10}}" wx:for-item="item" wx:for-index="index"><view data-event-opts="{{[['tap',[['openUrl',['/pages/index/goods_info']]]]]}}" style="background-color:#FFF;padding:20rpx;border-radius:20rpx;box-shadow:0rpx 0rpx 10rpx 0rpx rgba(12,0,5,0.1);margin-bottom:20rpx;" bindtap="__e"><view class="tn-text-ellipsis"><block wx:if="{{current==0}}"><tn-tag vue-id="{{'0ef0f4e9-4-'+index}}" shape="radius" size="sm" backgroundColor="tn-main-gradient-red--reverse" width="60rpx" bind:__l="__l" vue-slots="{{['default']}}">需求</tn-tag></block><block wx:if="{{current==1}}"><tn-tag vue-id="{{'0ef0f4e9-5-'+index}}" shape="radius" size="sm" backgroundColor="tn-main-gradient-blue" width="60rpx" bind:__l="__l" vue-slots="{{['default']}}">供应</tn-tag></block><text style="vertical-align:middle;padding-left:20rpx;font-size:30rpx;">劲捷飞燕系列P056C旅拍三脚架碳纤维摄影旅拍三脚架碳纤维摄影</text></view><view style="font-size:24rpx;color:#808080;margin-top:20rpx;">洛阳灵睿网络技术有限公司</view><view><tn-tag vue-id="{{'0ef0f4e9-6-'+index}}" shape="radius" width="auto" backgroundColor="#F7F7F7" fontColor="#808080" bind:__l="__l" vue-slots="{{['default']}}">洛阳市</tn-tag><tn-tag vue-id="{{'0ef0f4e9-7-'+index}}" shape="radius" margin="20rpx" width="auto" backgroundColor="#EBF4F7" fontColor="#3377FF" bind:__l="__l" vue-slots="{{['default']}}">合作意向18人</tn-tag><tn-tag vue-id="{{'0ef0f4e9-8-'+index}}" shape="radius" width="auto" backgroundColor="#F7F3EB" fontColor="#FF8C19" bind:__l="__l" vue-slots="{{['default']}}">项目金额1万以下</tn-tag></view><view class="tn-flex tn-flex-row-between tn-flex-col-center tn-flex-row-center" style="margin-top:20rpx;"><view style="color:#808080;font-size:24rpx;">2023-12-19</view><view><tn-button vue-id="{{'0ef0f4e9-9-'+index}}" shape="round" fontSize="{{22}}" width="148rpx" height="50rpx" backgroundColor="tn-main-gradient-orange" fontColor="#ffffff" bind:__l="__l" vue-slots="{{['default']}}">意向合作</tn-button></view></view></view></block></view></view></view>
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/goods_my"],{"0931":function(n,t,e){"use strict";e.r(t);var o=e("e507"),u=e("4505");for(var r in u)["default"].indexOf(r)<0&&function(n){e.d(t,n,(function(){return u[n]}))}(r);var a=e("f0c5"),i=Object(a["a"])(u["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);t["default"]=i.exports},4505:function(n,t,e){"use strict";e.r(t);var o=e("5cd7"),u=e.n(o);for(var r in o)["default"].indexOf(r)<0&&function(n){e.d(t,n,(function(){return o[n]}))}(r);t["default"]=u.a},"49bd":function(n,t,e){"use strict";(function(n,t){var o=e("4ea4");e("34f1");o(e("66fd"));var u=o(e("0931"));n.__webpack_require_UNI_MP_PLUGIN__=e,t(u.default)}).call(this,e("bc2e")["default"],e("543d")["createPage"])},"5cd7":function(n,t,e){"use strict";(function(n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={data:function(){return{topCurrent:0}},methods:{openUrl:function(t){n.navigateTo({url:t})},goBack:function(){getCurrentPages().length>1?n.navigateBack():n.redirectTo({url:"/pages/index/index"})}}};t.default=e}).call(this,e("543d")["default"])},e507:function(n,t,e){"use strict";e.d(t,"b",(function(){return u})),e.d(t,"c",(function(){return r})),e.d(t,"a",(function(){return o}));var o={tnNavBar:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-nav-bar/tn-nav-bar")]).then(e.bind(null,"5d27"))},tnTabs:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-tabs/tn-tabs")]).then(e.bind(null,"8772"))},tnTag:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-tag/tn-tag")]).then(e.bind(null,"3023"))},tnButton:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-button/tn-button")]).then(e.bind(null,"f566"))}},u=function(){var n=this.$createElement;this._self._c},r=[]}},[["49bd","common/runtime","common/vendor"]]]);
 | 
			
		||||
@ -1,10 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "navigationBarTitleText": "智慧云商协",
 | 
			
		||||
  "enablePullDownRefresh": false,
 | 
			
		||||
  "usingComponents": {
 | 
			
		||||
    "tn-nav-bar": "/tuniao-ui/components/tn-nav-bar/tn-nav-bar",
 | 
			
		||||
    "tn-tabs": "/tuniao-ui/components/tn-tabs/tn-tabs",
 | 
			
		||||
    "tn-tag": "/tuniao-ui/components/tn-tag/tn-tag",
 | 
			
		||||
    "tn-button": "/tuniao-ui/components/tn-button/tn-button"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
<view style="letter-spacing:1rpx;"><tn-nav-bar vue-id="702012db-1" isBack="{{false}}" backTitle bottomShadow="{{true}}" backgroundColor="#FFFFFF" bind:__l="__l" vue-slots="{{['default']}}"><view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left"><view data-event-opts="{{[['tap',[['goBack']]]]}}" style="padding-left:15rpx;" bindtap="__e"><text class="tn-icon-left" style="font-size:40rpx;"></text></view><view class="tn-margin-top" style="text-shadow:1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;"><tn-tabs vue-id="{{('702012db-2')+','+('702012db-1')}}" list="{{[{name:'供需记录'}]}}" current="{{topCurrent}}" activeColor="#000" bold="{{false}}" fontSize="{{36}}" bind:__l="__l"></tn-tabs></view></view></tn-nav-bar><view style="{{'padding-top:'+(vuex_custom_bar_height+10+'px')+';'}}"><view style="padding:10rpx  30rpx 100rpx 30rpx;"><block wx:for="{{3}}" wx:for-item="item" wx:for-index="index"><view data-event-opts="{{[['tap',[['openUrl',['/pages/index/goods_info']]]]]}}" style="background-color:#FFF;padding:20rpx;border-radius:20rpx;box-shadow:0rpx 0rpx 10rpx 0rpx rgba(12,0,5,0.1);margin-bottom:30rpx;" bindtap="__e"><view class="tn-text-ellipsis"><block wx:if="{{index%2==0}}"><tn-tag vue-id="{{'702012db-3-'+index}}" shape="radius" size="sm" backgroundColor="tn-main-gradient-red--reverse" width="60rpx" bind:__l="__l" vue-slots="{{['default']}}">需求</tn-tag></block><block wx:if="{{index%2!=0}}"><tn-tag vue-id="{{'702012db-4-'+index}}" shape="radius" size="sm" backgroundColor="tn-main-gradient-blue" width="60rpx" bind:__l="__l" vue-slots="{{['default']}}">供应</tn-tag></block><text style="vertical-align:middle;padding-left:20rpx;font-size:30rpx;">劲捷飞燕系列P056C旅拍三脚架碳纤维摄影旅拍三脚架碳纤维摄影</text></view><view style="font-size:24rpx;color:#808080;margin-top:20rpx;">洛阳灵睿网络技术有限公司</view><view><tn-tag vue-id="{{'702012db-5-'+index}}" shape="radius" width="auto" backgroundColor="#F7F7F7" fontColor="#808080" bind:__l="__l" vue-slots="{{['default']}}">洛阳市</tn-tag><tn-tag vue-id="{{'702012db-6-'+index}}" shape="radius" margin="20rpx" width="auto" backgroundColor="#EBF4F7" fontColor="#3377FF" bind:__l="__l" vue-slots="{{['default']}}">合作意向18人</tn-tag><tn-tag vue-id="{{'702012db-7-'+index}}" shape="radius" width="auto" backgroundColor="#F7F3EB" fontColor="#FF8C19" bind:__l="__l" vue-slots="{{['default']}}">项目金额1万以下</tn-tag></view><view class="tn-flex tn-flex-row-between tn-flex-col-center tn-flex-row-center" style="margin-top:20rpx;"><view style="color:#808080;font-size:24rpx;">2023-12-19</view><view><tn-button vue-id="{{'702012db-8-'+index}}" shape="round" fontSize="{{22}}" width="160rpx" height="50rpx" backgroundColor="tn-main-gradient-orange" fontColor="#ffffff" bind:__l="__l" vue-slots="{{['default']}}">查看详情</tn-button></view></view></view></block></view></view></view>
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/home"],{"09ea":function(t,n,e){"use strict";e.r(n);var i=e("d182"),o=e.n(i);for(var a in i)["default"].indexOf(a)<0&&function(t){e.d(n,t,(function(){return i[t]}))}(a);n["default"]=o.a},"0f73":function(t,n,e){"use strict";(function(t,n){var i=e("4ea4");e("34f1");i(e("66fd"));var o=i(e("ca31"));t.__webpack_require_UNI_MP_PLUGIN__=e,n(o.default)}).call(this,e("bc2e")["default"],e("543d")["createPage"])},"57e9":function(t,n,e){"use strict";e.d(n,"b",(function(){return o})),e.d(n,"c",(function(){return a})),e.d(n,"a",(function(){return i}));var i={tnNavBar:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-nav-bar/tn-nav-bar")]).then(e.bind(null,"5d27"))},tnNoticeBar:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-notice-bar/tn-notice-bar")]).then(e.bind(null,"5cc8"))},tnButton:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-button/tn-button")]).then(e.bind(null,"f566"))},tnTabs:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-tabs/tn-tabs")]).then(e.bind(null,"8772"))},tnSelect:function(){return e.e("tuniao-ui/components/tn-select/tn-select").then(e.bind(null,"eb22"))}},o=function(){var t=this,n=t.$createElement,e=(t._self._c,t.actList.length),i=t.actList.length;t._isMounted||(t.e0=function(n){t.selectShow=!0}),t.$mp.data=Object.assign({},{$root:{g0:e,g1:i}})},a=[]},ca31:function(t,n,e){"use strict";e.r(n);var i=e("57e9"),o=e("09ea");for(var a in o)["default"].indexOf(a)<0&&function(t){e.d(n,t,(function(){return o[t]}))}(a);var s=e("f0c5"),c=Object(s["a"])(o["default"],i["b"],i["c"],!1,null,"6b7fa3f3",null,!1,i["a"],void 0);n["default"]=c.exports},d182:function(t,n,e){"use strict";(function(t){var i=e("4ea4");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var o=i(e("448a")),a=e("0c91"),s=i(e("de98")),c={data:function(){return{selectShow:!1,selectList:[],topCurrent:0,searlist:["企业家名称/公司名称"],cardCur:0,isAndroid:!0,swiperList:[{url:"/static/banner.jpg"},{url:"/static/banner2.jpg"}],goryList:[],news_list:[],actList:[],current:0,page:1,size:10,gory_id:0,type:1,HomeTitle:"",apiImgUrl:this.$store.state.imgUrl}},mounted:function(){this.getNewsGoryList(),this.getActivityList(),this.getAssociationIndex()},methods:{confirm:function(n){var e=n[0];s.default.commit("$tStore",{name:"Gid",value:e.value}),t.setStorageSync("Gid",e.value),this.page=1,this.goryList=[],this.news_list=[],this.actList=[],this.getNewsGoryList(),this.getActivityList(),this.getAssociationIndex()},getAssociationIndex:function(){var n=this;(0,a.associationIndex)().then((function(t){if(console.log(t),1==t.code){var e=t.data,i=e.map((function(t){return{value:t.id,label:t.association_name,icon:t.association_image}})),o=i.find((function(t){return t.value==s.default.state.Gid}));n.HomeTitle=o.label,n.selectList=i,n.$parent.childEvent(o)}})).catch((function(n){t.showToast({title:n,icon:"none",duration:2e3})}))},getActivityList:function(){var n=this;(0,a.activityList)({association_id:s.default.state.Gid,page:1,size:5}).then((function(t){console.log(t),1==t.code?n.actList=t.data.ret:n.actList=[]})).catch((function(n){t.showToast({title:n,icon:"none",duration:2e3})}))},getNewsGoryList:function(){var n=this;(0,a.newsGoryList)({association_id:s.default.state.Gid}).then((function(t){if(console.log(t),1==t.code){var e=t.data;e.unshift({id:0,name:"最新"}),n.goryList=e,n.type=1,n.gory_id=0,n.getNewsList()}})).catch((function(n){t.showToast({title:n,icon:"none",duration:2e3})}))},getNewsList:function(){var n=this;(0,a.newsList)({association_id:s.default.state.Gid,type:this.type,gory_id:this.gory_id,page:this.page,size:this.size}).then((function(t){var e;(console.log(t),1==t.code)&&(e=n.news_list).push.apply(e,(0,o.default)(t.data.ret))})).catch((function(n){t.showToast({title:n,icon:"none",duration:2e3})}))},cardSwiper:function(t){this.cardCur=t.detail.current},ReachBottom:function(){console.log("home"),this.page=this.page+1,this.getNewsList()},change:function(t){this.current=t;var n=this.goryList[t];this.gory_id=n.id,this.type=0===t?1:0,this.page=1,this.news_list=[],this.getNewsList()},openUrl:function(n){t.navigateTo({url:n})},opentab:function(){t.$emit("depId",{index:1})}}};n.default=c}).call(this,e("543d")["default"])}},[["0f73","common/runtime","common/vendor"]]]);
 | 
			
		||||
@ -1,10 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "navigationBarTitleText": "智慧云商协",
 | 
			
		||||
  "usingComponents": {
 | 
			
		||||
    "tn-nav-bar": "/tuniao-ui/components/tn-nav-bar/tn-nav-bar",
 | 
			
		||||
    "tn-notice-bar": "/tuniao-ui/components/tn-notice-bar/tn-notice-bar",
 | 
			
		||||
    "tn-button": "/tuniao-ui/components/tn-button/tn-button",
 | 
			
		||||
    "tn-tabs": "/tuniao-ui/components/tn-tabs/tn-tabs",
 | 
			
		||||
    "tn-select": "/tuniao-ui/components/tn-select/tn-select"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1,11 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "navigationBarTitleText": "智慧云商协",
 | 
			
		||||
  "usingComponents": {
 | 
			
		||||
    "tn-tabbar": "/tuniao-ui/components/tn-tabbar/tn-tabbar",
 | 
			
		||||
    "home": "/pages/index/home",
 | 
			
		||||
    "service": "/pages/index/service",
 | 
			
		||||
    "discovery": "/pages/index/discovery",
 | 
			
		||||
    "pizz": "/pages/index/pizz",
 | 
			
		||||
    "user": "/pages/index/user"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
<view class="index data-v-2289f736"><block wx:if="{{tabberPageLoadFlag[0]}}"><view style="{{'display:'+(currentIndex===0?'':'none')+';'}}" class="data-v-2289f736"><scroll-view class="custom-tabbar-page data-v-2289f736" scroll-y="{{true}}" enable-back-to-top="{{true}}" data-event-opts="{{[['scrolltolower',[['tabbarPageScrollLower',['$event']]]]]}}" bindscrolltolower="__e"><home vue-id="8dd740cc-1" data-ref="home" class="data-v-2289f736 vue-ref" bind:__l="__l"></home></scroll-view></view></block><block wx:if="{{tabberPageLoadFlag[1]}}"><view style="{{'display:'+(currentIndex===1?'':'none')+';'}}" class="data-v-2289f736"><scroll-view class="custom-tabbar-page data-v-2289f736" scroll-y="{{true}}" enable-back-to-top="{{true}}" data-event-opts="{{[['scrolltolower',[['tabbarPageScrollLower',['$event']]]]]}}" bindscrolltolower="__e"><service vue-id="8dd740cc-2" data-ref="service" class="data-v-2289f736 vue-ref" bind:__l="__l"></service></scroll-view></view></block><block wx:if="{{tabberPageLoadFlag[2]}}"><view style="{{'display:'+(currentIndex===2?'':'none')+';'}}" class="data-v-2289f736"><scroll-view class="custom-tabbar-page data-v-2289f736" scroll-y="{{true}}" enable-back-to-top="{{true}}" data-event-opts="{{[['scrolltolower',[['tabbarPageScrollLower',['$event']]]]]}}" bindscrolltolower="__e"><discovery vue-id="8dd740cc-3" data-ref="discovery" class="data-v-2289f736 vue-ref" bind:__l="__l"></discovery></scroll-view></view></block><block wx:if="{{tabberPageLoadFlag[3]}}"><view style="{{'display:'+(currentIndex===3?'':'none')+';'}}" class="data-v-2289f736"><scroll-view class="custom-tabbar-page data-v-2289f736" scroll-y="{{true}}" enable-back-to-top="{{true}}" data-event-opts="{{[['scrolltolower',[['tabbarPageScrollLower',['$event']]]]]}}" bindscrolltolower="__e"><pizz vue-id="8dd740cc-4" data-ref="pizz" class="data-v-2289f736 vue-ref" bind:__l="__l"></pizz></scroll-view></view></block><block wx:if="{{tabberPageLoadFlag[4]}}"><view style="{{'display:'+(currentIndex===4?'':'none')+';'}}" class="data-v-2289f736"><scroll-view class="custom-tabbar-page data-v-2289f736" scroll-y="{{true}}" enable-back-to-top="{{true}}" data-event-opts="{{[['scrolltolower',[['tabbarPageScrollLower',['$event']]]]]}}" bindscrolltolower="__e"><user vue-id="8dd740cc-5" data-ref="user" class="data-v-2289f736 vue-ref" bind:__l="__l"></user></scroll-view></view></block><tn-tabbar vue-id="8dd740cc-6" outHeight="{{140}}" height="{{120}}" list="{{tabbarList}}" activeColor="#3377FF" inactiveColor="#AAAAAA" activeIconColor="#3377FF" inactiveIconColor="#8A8E99" animation="{{true}}" safeAreaInsetBottom="{{true}}" value="{{currentIndex}}" data-event-opts="{{[['^change',[['switchTabbar']]],['^input',[['__set_model',['','currentIndex','$event',[]]]]]]}}" bind:change="__e" bind:input="__e" class="data-v-2289f736" bind:__l="__l"></tn-tabbar></view>
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
.index.data-v-2289f736{width:100%;height:100vh;position:relative}.index .custom-tabbar-page.data-v-2289f736{width:100%;height:calc(100vh - 110rpx);box-sizing:border-box;padding-bottom:0rpx;padding-bottom:calc(0rpx + constant(safe-area-inset-bottom));padding-bottom:calc(0rpx + env(safe-area-inset-bottom))}
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/knowledge_list"],{"480e":function(t,n,e){"use strict";e.d(n,"b",(function(){return i})),e.d(n,"c",(function(){return o})),e.d(n,"a",(function(){return a}));var a={tnNavBar:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-nav-bar/tn-nav-bar")]).then(e.bind(null,"5d27"))},tnTabs:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-tabs/tn-tabs")]).then(e.bind(null,"8772"))}},i=function(){var t=this.$createElement;this._self._c},o=[]},9682:function(t,n,e){"use strict";e.r(n);var a=e("480e"),i=e("a9a8");for(var o in i)["default"].indexOf(o)<0&&function(t){e.d(n,t,(function(){return i[t]}))}(o);var r=e("f0c5"),u=Object(r["a"])(i["default"],a["b"],a["c"],!1,null,null,null,!1,a["a"],void 0);n["default"]=u.exports},"9d88":function(t,n,e){"use strict";(function(t){var a=e("4ea4");Object.defineProperty(n,"__esModule",{value:!0}),n.default=void 0;var i=a(e("448a")),o=e("0c91"),r=a(e("de98")),u={data:function(){return{topCurrent:0,gory_id:53,news_list:[],apiImgUrl:this.$store.state.imgUrl,page:1,size:10}},onLoad:function(){this.getNewsList()},onReachBottom:function(){this.page=this.page+1,this.getNewsList()},methods:{getNewsList:function(){var n=this;(0,o.newsList)({association_id:r.default.state.Gid,gory_id:this.gory_id,page:this.page,size:this.size}).then((function(t){var e;(console.log(t),1==t.code)&&(e=n.news_list).push.apply(e,(0,i.default)(t.data.ret))})).catch((function(n){t.showToast({title:n,icon:"none",duration:2e3})}))},openUrl:function(n){t.navigateTo({url:n})},goBack:function(){getCurrentPages().length>1?t.navigateBack():t.redirectTo({url:"/pages/index/index"})}}};n.default=u}).call(this,e("543d")["default"])},a9a8:function(t,n,e){"use strict";e.r(n);var a=e("9d88"),i=e.n(a);for(var o in a)["default"].indexOf(o)<0&&function(t){e.d(n,t,(function(){return a[t]}))}(o);n["default"]=i.a},da73:function(t,n,e){"use strict";(function(t,n){var a=e("4ea4");e("34f1");a(e("66fd"));var i=a(e("9682"));t.__webpack_require_UNI_MP_PLUGIN__=e,n(i.default)}).call(this,e("bc2e")["default"],e("543d")["createPage"])}},[["da73","common/runtime","common/vendor"]]]);
 | 
			
		||||
@ -1,8 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "navigationBarTitleText": "智慧云商协",
 | 
			
		||||
  "enablePullDownRefresh": false,
 | 
			
		||||
  "usingComponents": {
 | 
			
		||||
    "tn-nav-bar": "/tuniao-ui/components/tn-nav-bar/tn-nav-bar",
 | 
			
		||||
    "tn-tabs": "/tuniao-ui/components/tn-tabs/tn-tabs"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
<view style="background-color:#EBF4F7;letter-spacing:1rpx;height:100vh;"><tn-nav-bar vue-id="20c82311-1" isBack="{{false}}" backTitle bottomShadow="{{true}}" backgroundColor="#FFFFFF" bind:__l="__l" vue-slots="{{['default']}}"><view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left"><view data-event-opts="{{[['tap',[['goBack']]]]}}" style="padding-left:15rpx;" bindtap="__e"><text class="tn-icon-left" style="font-size:40rpx;"></text></view><view class="tn-margin-top" style="text-shadow:1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;"><tn-tabs vue-id="{{('20c82311-2')+','+('20c82311-1')}}" list="{{[{name:'商学院'}]}}" current="{{topCurrent}}" activeColor="#000" bold="{{false}}" fontSize="{{36}}" bind:__l="__l"></tn-tabs></view></view></tn-nav-bar><view style="{{'padding-top:'+(vuex_custom_bar_height+'px')+';'}}"><view style="padding:10px 30rpx;"><block wx:for="{{news_list}}" wx:for-item="item" wx:for-index="index"><view data-event-opts="{{[['tap',[['openUrl',['/pages/index/new_info?id='+item.news_id]]]]]}}" class="tn-flex tn-flex-row-between" style="background-color:#ffffff;padding:20rpx;border-radius:10rpx;margin-bottom:10rpx;" bindtap="__e"><view style="position:relative;"><view class="tn-text-ellipsis-2" style="font-size:28rpx;">{{item.news_title}}</view><view class="tn-flex tn-flex-row-between" style="position:absolute;bottom:0rpx;width:100%;color:#808080;"><view><text class="tn-icon-eye"></text><text>568</text></view></view></view><view style="margin-left:20rpx;"><image style="width:200rpx;height:135rpx;border-radius:10rpx;" src="{{apiImgUrl+item.news_image}}"></image></view></view></block></view></view></view>
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/my_apply"],{"2b87":function(n,t,e){"use strict";e.r(t);var o=e("4589"),a=e("90b0");for(var r in a)["default"].indexOf(r)<0&&function(n){e.d(t,n,(function(){return a[n]}))}(r);var u=e("f0c5"),i=Object(u["a"])(a["default"],o["b"],o["c"],!1,null,null,null,!1,o["a"],void 0);t["default"]=i.exports},4589:function(n,t,e){"use strict";e.d(t,"b",(function(){return a})),e.d(t,"c",(function(){return r})),e.d(t,"a",(function(){return o}));var o={tnNavBar:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-nav-bar/tn-nav-bar")]).then(e.bind(null,"5d27"))},tnTabs:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-tabs/tn-tabs")]).then(e.bind(null,"8772"))}},a=function(){var n=this.$createElement;this._self._c},r=[]},"8ffe":function(n,t,e){"use strict";(function(n){var o=e("4ea4");Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=e("0c91"),r=(o(e("de98")),{data:function(){return{topCurrent:0,userInfo:{},uid:0,apiImgUrl:this.$store.state.imgUrl}},onLoad:function(){var t=n.getStorageSync("uid");this.uid=t,this.getUserInfo()},methods:{getUserInfo:function(){var t=this;(0,a.getUserIndex)({member_id:this.uid}).then((function(n){console.log(n),1==n.code&&(t.userInfo=n.data)})).catch((function(t){n.showToast({title:t,icon:"none",duration:2e3})}))},openUrl:function(t){n.navigateTo({url:t})},goBack:function(){getCurrentPages().length>1?n.navigateBack():n.redirectTo({url:"/pages/index/index"})}}});t.default=r}).call(this,e("543d")["default"])},"90b0":function(n,t,e){"use strict";e.r(t);var o=e("8ffe"),a=e.n(o);for(var r in o)["default"].indexOf(r)<0&&function(n){e.d(t,n,(function(){return o[n]}))}(r);t["default"]=a.a},c1e3:function(n,t,e){"use strict";(function(n,t){var o=e("4ea4");e("34f1");o(e("66fd"));var a=o(e("2b87"));n.__webpack_require_UNI_MP_PLUGIN__=e,t(a.default)}).call(this,e("bc2e")["default"],e("543d")["createPage"])}},[["c1e3","common/runtime","common/vendor"]]]);
 | 
			
		||||
@ -1,8 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "navigationBarTitleText": "智慧云商协",
 | 
			
		||||
  "enablePullDownRefresh": false,
 | 
			
		||||
  "usingComponents": {
 | 
			
		||||
    "tn-nav-bar": "/tuniao-ui/components/tn-nav-bar/tn-nav-bar",
 | 
			
		||||
    "tn-tabs": "/tuniao-ui/components/tn-tabs/tn-tabs"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
<view style="letter-spacing:1rpx;"><tn-nav-bar vue-id="1d3ba2b5-1" isBack="{{false}}" backTitle bottomShadow="{{true}}" backgroundColor="#FFFFFF" bind:__l="__l" vue-slots="{{['default']}}"><view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left"><view data-event-opts="{{[['tap',[['goBack']]]]}}" style="padding-left:15rpx;" bindtap="__e"><text class="tn-icon-left" style="font-size:40rpx;"></text></view><view class="tn-margin-top" style="text-shadow:1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;"><tn-tabs vue-id="{{('1d3ba2b5-2')+','+('1d3ba2b5-1')}}" list="{{[{name:'入会申请记录'}]}}" current="{{topCurrent}}" activeColor="#000" bold="{{false}}" fontSize="{{36}}" bind:__l="__l"></tn-tabs></view></view></tn-nav-bar><view style="{{'padding-top:'+(vuex_custom_bar_height+20+'px')+';'}}"><view style="padding:0rpx 30rpx 180rpx 30rpx;"><view data-event-opts="{{[['tap',[['openUrl',['/pages/index/pizz_info?id='+userInfo.association_id]]]]]}}" style="position:relative;box-shadow:rgba(12, 0, 5, 0.1) 0px 0px 5px 0px;background-color:#ffffff;" bindtap="__e"><view class="tn-flex tn-flex-center tn-flex-col-center" style="background-color:#ffffff;padding:60rpx 30rpx;border-radius:15rpx;margin-bottom:20rpx;"><view><image style="width:100rpx;height:100rpx;border-radius:50%;" src="{{apiImgUrl+userInfo.association_image}}"></image></view><view style="margin-left:20rpx;"><view style="font-size:31rpx;font-weight:600;letter-spacing:5rpx;">{{userInfo.association_name}}</view><view style="font-size:24rpx;color:#808080;margin-top:15rpx;">{{"成立时间:"+userInfo.association_createtime}}</view></view></view><block wx:if="{{userInfo.status==0}}"><view style="font-size:20rpx;color:#ffffff;background-color:#FBBD12;position:absolute;top:0;right:0;border-radius:0px 15rpx 0px 15rpx;padding:10rpx 10rpx;"><text class="tn-icon-success-circle-fill" style="vertical-align:middle;"></text><text style="vertical-align:middle;margin-left:5rpx;">审核中</text></view></block><block wx:if="{{userInfo.status==1}}"><view style="font-size:20rpx;color:#ffffff;background-color:#31C9E8;position:absolute;top:0;right:0;border-radius:0px 15rpx 0px 15rpx;padding:10rpx 10rpx;"><text class="tn-icon-success-circle-fill" style="vertical-align:middle;"></text><text style="vertical-align:middle;margin-left:5rpx;">正式会员</text></view></block><block wx:if="{{userInfo.status==2}}"><view style="font-size:20rpx;color:#ffffff;background-color:#FF7043;position:absolute;top:0;right:0;border-radius:0px 15rpx 0px 15rpx;padding:10rpx 10rpx;"><text class="tn-icon-success-circle-fill" style="vertical-align:middle;"></text><text style="vertical-align:middle;margin-left:5rpx;">被拒绝</text></view></block></view></view></view></view>
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/my_assist"],{"1c4d":function(n,t,e){"use strict";(function(n,t){var a=e("4ea4");e("34f1");a(e("66fd"));var u=a(e("dbff"));n.__webpack_require_UNI_MP_PLUGIN__=e,t(u.default)}).call(this,e("bc2e")["default"],e("543d")["createPage"])},"38b5":function(n,t,e){"use strict";e.d(t,"b",(function(){return u})),e.d(t,"c",(function(){return i})),e.d(t,"a",(function(){return a}));var a={tnNavBar:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-nav-bar/tn-nav-bar")]).then(e.bind(null,"5d27"))},tnTabs:function(){return Promise.all([e.e("common/vendor"),e.e("tuniao-ui/components/tn-tabs/tn-tabs")]).then(e.bind(null,"8772"))}},u=function(){var n=this.$createElement;this._self._c},i=[]},"5ca1":function(n,t,e){"use strict";(function(n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e={data:function(){return{topCurrent:0,helpList:[{title:"关于隐私授权",name:""},{title:"账号无法退出切换账号",name:""},{title:"无法授权微信登录",name:""},{title:"积分记录不见了",name:""}]}},methods:{goBack:function(){getCurrentPages().length>1?n.navigateBack():n.redirectTo({url:"/pages/index/index"})},tn:function(t){n.navigateTo({url:t})}}};t.default=e}).call(this,e("543d")["default"])},"98de":function(n,t,e){},dbff:function(n,t,e){"use strict";e.r(t);var a=e("38b5"),u=e("f401");for(var i in u)["default"].indexOf(i)<0&&function(n){e.d(t,n,(function(){return u[n]}))}(i);e("ef91");var r=e("f0c5"),o=Object(r["a"])(u["default"],a["b"],a["c"],!1,null,"6299e1ca",null,!1,a["a"],void 0);t["default"]=o.exports},ef91:function(n,t,e){"use strict";var a=e("98de"),u=e.n(a);u.a},f401:function(n,t,e){"use strict";e.r(t);var a=e("5ca1"),u=e.n(a);for(var i in a)["default"].indexOf(i)<0&&function(n){e.d(t,n,(function(){return a[n]}))}(i);t["default"]=u.a}},[["1c4d","common/runtime","common/vendor"]]]);
 | 
			
		||||
@ -1,8 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "navigationBarTitleText": "智慧云商协",
 | 
			
		||||
  "enablePullDownRefresh": false,
 | 
			
		||||
  "usingComponents": {
 | 
			
		||||
    "tn-nav-bar": "/tuniao-ui/components/tn-nav-bar/tn-nav-bar",
 | 
			
		||||
    "tn-tabs": "/tuniao-ui/components/tn-tabs/tn-tabs"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
<view class="tn-safe-area-inset-bottom data-v-6299e1ca"><tn-nav-bar vue-id="2247a750-1" isBack="{{false}}" backTitle bottomShadow="{{true}}" backgroundColor="#FFFFFF" class="data-v-6299e1ca" bind:__l="__l" vue-slots="{{['default']}}"><view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left data-v-6299e1ca"><view data-event-opts="{{[['tap',[['goBack']]]]}}" style="padding-left:15rpx;" bindtap="__e" class="data-v-6299e1ca"><text class="tn-icon-left data-v-6299e1ca" style="font-size:40rpx;"></text></view><view class="tn-margin-top data-v-6299e1ca" style="text-shadow:1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;"><tn-tabs vue-id="{{('2247a750-2')+','+('2247a750-1')}}" list="{{[{name:'帮助中心'}]}}" current="{{topCurrent}}" activeColor="#000" bold="{{false}}" fontSize="{{36}}" class="data-v-6299e1ca" bind:__l="__l"></tn-tabs></view></view></tn-nav-bar><view class="tn-margin-bottom-xl data-v-6299e1ca" style="{{'padding-top:'+(vuex_custom_bar_height+'px')+';'}}"><view class="tn-flex tn-flex-row-between tn-padding tn-strip-bottom-min tn-margin-top-xs data-v-6299e1ca"><view class="justify-content-item data-v-6299e1ca"><view class="tn-text-bold tn-text-lg data-v-6299e1ca">常见问题</view></view></view><block wx:for="{{helpList}}" wx:for-item="item" wx:for-index="index" wx:key="index"><view data-event-opts="{{[['tap',[['tn',['/minePages/content']]]]]}}" class="tn-flex tn-flex-row-between tn-strip-bottom-min tn-padding tn-margin-top-xs data-v-6299e1ca" bindtap="__e"><view class="justify-content-item data-v-6299e1ca"><view class="tn-text-df data-v-6299e1ca">{{''+item.title+''}}</view></view><view class="justify-content-item tn-text-lg tn-color-grey data-v-6299e1ca"><view class="tn-icon-right data-v-6299e1ca"></view></view></view></block><view class="tn-flex tn-flex-row-between tn-padding tn-strip-bottom-min tn-strip-top data-v-6299e1ca"><view class="justify-content-item data-v-6299e1ca"><view class="tn-text-bold tn-text-lg data-v-6299e1ca">登录问题</view></view></view><block wx:for="{{helpList}}" wx:for-item="item" wx:for-index="index"><view data-event-opts="{{[['tap',[['tn',['/minePages/content']]]]]}}" class="tn-flex tn-flex-row-between tn-strip-bottom-min tn-padding tn-margin-top-xs data-v-6299e1ca" bindtap="__e"><view class="justify-content-item data-v-6299e1ca"><view class="tn-text-df data-v-6299e1ca">{{''+item.title+''}}</view></view><view class="justify-content-item tn-text-lg tn-color-grey data-v-6299e1ca"><view class="tn-icon-right data-v-6299e1ca"></view></view></view></block><view class="tn-flex tn-flex-row-between tn-padding tn-strip-bottom-min tn-strip-top data-v-6299e1ca"><view class="justify-content-item data-v-6299e1ca"><view class="tn-text-bold tn-text-lg data-v-6299e1ca">其他问题</view></view></view><block wx:for="{{helpList}}" wx:for-item="item" wx:for-index="index"><view data-event-opts="{{[['tap',[['tn',['/minePages/content']]]]]}}" class="tn-flex tn-flex-row-between tn-strip-bottom-min tn-padding tn-margin-top-xs data-v-6299e1ca" bindtap="__e"><view class="justify-content-item data-v-6299e1ca"><view class="tn-text-df data-v-6299e1ca">{{''+item.title+''}}</view></view><view class="justify-content-item tn-text-lg tn-color-grey data-v-6299e1ca"><view class="tn-icon-right data-v-6299e1ca"></view></view></view></block></view><view class="tn-tabbar-height data-v-6299e1ca"></view></view>
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
.tn-strip-bottom-min.data-v-6299e1ca{width:100%;border-bottom:1rpx solid #f8f9fb}.tn-strip-top.data-v-6299e1ca{width:100%;border-top:20rpx solid hsla(0,0%,94.5%,.8)}.user-image.data-v-6299e1ca{width:90rpx;height:90rpx;position:relative}.user-pic.data-v-6299e1ca{background-size:cover;background-repeat:no-repeat;background-position:top;border-radius:50%;overflow:hidden;background-color:#fff}.tn-tabbar-height.data-v-6299e1ca{min-height:120rpx;height:calc(140rpx + env(safe-area-inset-bottom) / 2);height:calc(140rpx + constant(safe-area-inset-bottom))}.tn-footerfixed.data-v-6299e1ca{position:fixed;background-color:hsla(0,0%,100%,.5);box-shadow:0rpx 0rpx 30rpx 0rpx rgba(0,0,0,.07);bottom:0;width:100%;transition:all .25s ease-out;z-index:100}
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pages/index/my_card"],{"0302":function(n,e,t){"use strict";(function(n,e){var i=t("4ea4");t("34f1");i(t("66fd"));var o=i(t("9d2b"));n.__webpack_require_UNI_MP_PLUGIN__=t,e(o.default)}).call(this,t("bc2e")["default"],t("543d")["createPage"])},"19d9":function(n,e,t){"use strict";t.d(e,"b",(function(){return o})),t.d(e,"c",(function(){return r})),t.d(e,"a",(function(){return i}));var i={tnNavBar:function(){return Promise.all([t.e("common/vendor"),t.e("tuniao-ui/components/tn-nav-bar/tn-nav-bar")]).then(t.bind(null,"5d27"))},tnTabs:function(){return Promise.all([t.e("common/vendor"),t.e("tuniao-ui/components/tn-tabs/tn-tabs")]).then(t.bind(null,"8772"))}},o=function(){var n=this.$createElement;this._self._c},r=[]},2994:function(n,e,t){"use strict";(function(n){var i=t("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=t("0c91"),r=(i(t("de98")),{data:function(){return{topCurrent:0,uid:0,this_uid:0,userInfo:{},userThisInfo:{},apiImgUrl:this.$store.state.imgUrl,is:!1}},onLoad:function(e){var t=n.getStorageSync("uid");this.uid=t,this.this_uid=e.id,this.getUserInfo()},onShareAppMessage:function(n){var e=this.info;return console.log(e),{title:this.userThisInfo.nikename,path:"/pages/index/my_card?id="+this.userThisInfo.member_id,imageUrl:this.apiImgUrl+this.userThisInfo.photo_image}},methods:{callPhone:function(){var e=this.userThisInfo.phone;n.makePhoneCall({phoneNumber:e,success:function(){console.log("拨打电话成功")},fail:function(){console.log("拨打电话失败")}})},getThisUserInfo:function(){var e=this;(0,o.getUserIndex)({member_id:this.this_uid}).then((function(n){1==n.code&&(e.userThisInfo=n.data)})).catch((function(e){n.showToast({title:e,icon:"none",duration:2e3})}))},getUserInfo:function(){var e=this;(0,o.getUserIndex)({member_id:this.uid}).then((function(n){1==n.code&&(e.userInfo=n.data,e.this_uid!=e.uid?e.getThisUserInfo():(e.is=!0,e.userThisInfo=n.data))})).catch((function(e){n.showToast({title:e,icon:"none",duration:2e3})}))},openUrl:function(e){n.navigateTo({url:e})},goBack:function(){getCurrentPages().length>1?n.navigateBack():n.redirectTo({url:"/pages/index/index"})}}});e.default=r}).call(this,t("543d")["default"])},"77cc":function(n,e,t){"use strict";var i=t("d1fe"),o=t.n(i);o.a},"91de":function(n,e,t){"use strict";t.r(e);var i=t("2994"),o=t.n(i);for(var r in i)["default"].indexOf(r)<0&&function(n){t.d(e,n,(function(){return i[n]}))}(r);e["default"]=o.a},"9d2b":function(n,e,t){"use strict";t.r(e);var i=t("19d9"),o=t("91de");for(var r in o)["default"].indexOf(r)<0&&function(n){t.d(e,n,(function(){return o[n]}))}(r);t("77cc");var a=t("f0c5"),u=Object(a["a"])(o["default"],i["b"],i["c"],!1,null,"4ef2d271",null,!1,i["a"],void 0);e["default"]=u.exports},d1fe:function(n,e,t){}},[["0302","common/runtime","common/vendor"]]]);
 | 
			
		||||
@ -1,8 +0,0 @@
 | 
			
		||||
{
 | 
			
		||||
  "navigationBarTitleText": "智慧云商协",
 | 
			
		||||
  "enablePullDownRefresh": false,
 | 
			
		||||
  "usingComponents": {
 | 
			
		||||
    "tn-nav-bar": "/tuniao-ui/components/tn-nav-bar/tn-nav-bar",
 | 
			
		||||
    "tn-tabs": "/tuniao-ui/components/tn-tabs/tn-tabs"
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
<view class="page-c data-v-4ef2d271"><tn-nav-bar vue-id="20e0a46e-1" isBack="{{false}}" backTitle bottomShadow="{{true}}" backgroundColor="#FFFFFF" class="data-v-4ef2d271" bind:__l="__l" vue-slots="{{['default']}}"><view class="custom-nav tn-flex tn-flex-col-center tn-flex-row-left data-v-4ef2d271"><view data-event-opts="{{[['tap',[['goBack']]]]}}" style="padding-left:15rpx;" bindtap="__e" class="data-v-4ef2d271"><text class="tn-icon-left data-v-4ef2d271" style="font-size:40rpx;"></text></view><view class="tn-margin-top data-v-4ef2d271" style="text-shadow:1rpx 0 0 #FFF, 0 1rpx 0 #FFF, -1rpx 0 0 #FFF , 0 -1rpx 0 #FFF;"><tn-tabs vue-id="{{('20e0a46e-2')+','+('20e0a46e-1')}}" list="{{[{name:'我的名片'}]}}" current="{{topCurrent}}" activeColor="#000" bold="{{false}}" fontSize="{{36}}" class="data-v-4ef2d271" bind:__l="__l"></tn-tabs></view></view></tn-nav-bar><view style="{{'padding-top:'+(vuex_custom_bar_height+20+'px')+';'}}" class="data-v-4ef2d271"><view class="tn-strip-bottom data-v-4ef2d271"><view class="slideshow data-v-4ef2d271"><image style="width:300rpx;height:300rpx;border-radius:50%;" src="{{apiImgUrl+userThisInfo.photo_image}}" class="data-v-4ef2d271"></image></view><view class="tn-margin data-v-4ef2d271"><view class="tn-text-bold data-v-4ef2d271"><text class="tn-text-xxl tn-padding-right data-v-4ef2d271">{{userThisInfo.nikename}}</text><text class="tn-text-lg tn-color-gray data-v-4ef2d271">{{userThisInfo.enterprise_name}}</text></view><block wx:if="{{userThisInfo.association_id==userInfo.association_id||is}}"><view class="tn-margin-top-lg data-v-4ef2d271"><text class="tn-text-lg data-v-4ef2d271">{{"微信:"+userThisInfo.wx_number}}</text><text class="tn-icon-copy tn-color-blue tn-padding-left-xs data-v-4ef2d271"></text></view><view data-event-opts="{{[['tap',[['callPhone',['$event']]]]]}}" class="tn-margin-top-xs data-v-4ef2d271" bindtap="__e"><text class="tn-text-lg data-v-4ef2d271">{{"电话:"+userThisInfo.phone}}</text><text class="tn-icon-phone tn-color-orange tn-padding-left-xs data-v-4ef2d271"></text></view></block><block wx:if="{{userThisInfo.association_id!=userInfo.association_id&&!is}}"><view class="tn-margin-top-lg data-v-4ef2d271"><text class="tn-text-lg data-v-4ef2d271">微信:加入协会后查看</text><text class="tn-icon-copy tn-color-blue tn-padding-left-xs data-v-4ef2d271"></text></view><view class="tn-margin-top-xs data-v-4ef2d271"><text class="tn-text-lg data-v-4ef2d271">电话:加入协会后查看</text><text class="tn-icon-phone tn-color-orange tn-padding-left-xs data-v-4ef2d271"></text></view></block></view></view><view class="king-list tn-margin-top-sm data-v-4ef2d271"><view class="king-icon data-v-4ef2d271"><text class="tn-icon-creative tn-color-white tn-text-lg tn-bg-blue tn-round tn-padding-xs data-v-4ef2d271"></text><text class="tn-text-xl tn-margin-left data-v-4ef2d271">自我介绍</text></view><view class="king-item tn-color-red tn-icon-circle-fill data-v-4ef2d271"><view class="resume2 data-v-4ef2d271"><text class="data-v-4ef2d271">{{''+userThisInfo.introduction+''}}</text></view></view><view class="king-icon data-v-4ef2d271"><text class="tn-icon-company tn-color-white tn-text-lg tn-bg-blue tn-round tn-padding-xs data-v-4ef2d271"></text><text class="tn-text-xl tn-margin-left data-v-4ef2d271">公司介绍</text></view><view class="king-item tn-color-red tn-icon-circle-fill data-v-4ef2d271"><view class="data-v-4ef2d271"><view class="resume2 data-v-4ef2d271"><text class="data-v-4ef2d271">{{userThisInfo.enterprise_name}}</text></view><view class="resume2 data-v-4ef2d271"><text class="data-v-4ef2d271">{{''+userThisInfo.enterprise_Introduction+''}}</text></view></view></view></view></view><view class="data-v-4ef2d271"><view class="icon15__item--icon tn-flex tn-flex-row-center tn-flex-col-center tn-shadow-blur button-2 data-v-4ef2d271"><button class="tn-button--clear-style data-v-4ef2d271" style="border-radius:0;" open-type="share"><view class="tn-icon-send-fill tn-color-white data-v-4ef2d271"></view></button></view></view><view class="tn-tabbar-height data-v-4ef2d271"></view><view class="bg-tabbar-shadow data-v-4ef2d271"></view></view>
 | 
			
		||||
@ -1 +0,0 @@
 | 
			
		||||
.page-c.data-v-4ef2d271{background-color:#ebf4f7;height:100vh}.tn-tabbar-height.data-v-4ef2d271{min-height:120rpx;height:calc(140rpx + env(safe-area-inset-bottom) / 2);height:calc(140rpx + constant(safe-area-inset-bottom))}.tn-footerfixed.data-v-4ef2d271{position:fixed;width:100%;bottom:calc(180rpx + env(safe-area-inset-bottom));z-index:1024;box-shadow:0 1rpx 6rpx transparent}.button-1.data-v-4ef2d271{background-color:rgba(0,0,0,.15);position:fixed;bottom:27%;right:30rpx;z-index:1001;border-radius:100px}.button-2.data-v-4ef2d271{background-color:rgba(0,0,0,.15);position:fixed;bottom:18%;right:30rpx;z-index:1001;border-radius:100px}.icon15__item.data-v-4ef2d271{width:30%;border-radius:10rpx;padding:30rpx;margin:20rpx 10rpx;-webkit-transform:scale(1);transform:scale(1);transition:-webkit-transform .3s linear;transition:transform .3s linear;transition:transform .3s linear,-webkit-transform .3s linear;-webkit-transform-origin:center center;transform-origin:center center}.icon15__item--icon.data-v-4ef2d271{width:100rpx;height:100rpx;font-size:50rpx;border-radius:50%;margin-bottom:18rpx;z-index:1}.icon15__item--icon.data-v-4ef2d271::after{content:" ";position:absolute;z-index:-1;width:100%;height:100%;left:0;bottom:0;border-radius:inherit;opacity:1;-webkit-transform:scale(1);transform:scale(1);background-size:100% 100%}.slideshow.data-v-4ef2d271{overflow:hidden;text-align:center}.king-list.data-v-4ef2d271{display:block}.king-list .king-icon.data-v-4ef2d271{width:100%;text-align:left;padding:20rpx 0 20rpx 37rpx;font-size:26rpx;color:#888;display:block}.king-list > .king-item.data-v-4ef2d271{padding:30rpx 30rpx 30rpx 120rpx;position:relative;display:block;z-index:0}.king-list > .king-item.data-v-4ef2d271::after{content:"";display:block;position:absolute;width:1rpx;background-color:#e6e6e6;left:60rpx;height:100%;top:0;z-index:8}.king-list > .king-item.data-v-4ef2d271::before{display:block;position:absolute;top:36rpx;z-index:9;background-color:#fff;width:50rpx;height:50rpx;text-align:center;border:none;line-height:50rpx;left:36rpx}.img-solid.data-v-4ef2d271{border:1rpx solid #eee}.share-img.data-v-4ef2d271{position:fixed;width:100rpx;height:100rpx;bottom:200rpx;right:20rpx;z-index:1024;opacity:.8;box-shadow:0rpx 8rpx 30rpx 0rpx rgba(0,0,0,.3);border:none;border:6rpx solid hsla(0,0%,100%,0)}.resume.data-v-4ef2d271{display:flex;justify-content:space-between;padding-top:10rpx;border-radius:6rpx;color:#666;line-height:1.6}.resume + .resume.data-v-4ef2d271{margin-top:20rpx}.resume2.data-v-4ef2d271{padding-top:10rpx;border-radius:6rpx;display:block;color:#666;line-height:1.6;text-align:justify}.tn-strip-bottom.data-v-4ef2d271{width:100%;border-bottom:5rpx solid #fff}.bg-img-cont.data-v-4ef2d271{background-size:cover;background-position:50%;background-repeat:no-repeat;height:350rpx;margin:20rpx 0;border-radius:8rpx}.tn-tag-content__item.data-v-4ef2d271{display:inline-block;line-height:45rpx;padding:10rpx 30rpx;margin:0rpx 20rpx 25rpx 0rpx}.tn-tag-content__item--prefix.data-v-4ef2d271{padding-right:10rpx}.see.data-v-4ef2d271{display:flex;justify-content:space-between;padding-top:10rpx;border-radius:6rpx;color:#666;line-height:1.6}
 | 
			
		||||