hwb0 пре 3 година
родитељ
комит
b351a5d24c

+ 0 - 5
App.vue

@@ -9,12 +9,7 @@
 		},
 		onShow: function() {
 			this.updateManager()
-			
 		},
-		onHide: function() {
-			
-		},
-
 		methods: {
 			updateManager() {
 				const updateManager = uni.getUpdateManager();

+ 0 - 0
components/hch-poster/utils/index.js → common/poster.js


+ 0 - 273
components/hch-poster/draw-demo.vue

@@ -1,273 +0,0 @@
-<!--
- * @Description: 生成海报组件
- * @Version: 1.0.0
- * @Autor: hch
- * @Date: 2020-08-07 14:48:41
- * @LastEditors: Please set LastEditors
- * @LastEditTime: 2021-07-30 09:25:07
- * 保存海报按钮和关闭按钮 在html代码中写出来 绑定点击方法然后透明 再用canvas 覆盖
--->
-
-<template>
-  <view class="content">
-    <view class="btn" @tap="handleDraw('square1')">正方形</view>
-    <view class="btn" @tap="handleDraw('square2')">圆角方形</view>
-    <view class="btn" @tap="handleDraw('square3')">圆形</view>
-    <view class="btn" @tap="handleDraw('pic1')">图片</view>
-    <view class="btn" @tap="handleDraw('text1')">左对齐文本</view>
-    <view class="btn" @tap="handleDraw('text2')">居中对齐文本</view>
-    <view class="btn" @tap="handleDraw('text3')">右对齐文本</view>
-
-    <view
-      class="canvas-content"
-      v-show="canvasShow"
-      :style="'width:' + system.w + 'px; height:' + system.h + 'px;'"
-    >
-      <!-- 遮罩层 -->
-      <view class="canvas-mask"></view>
-      <!-- :width="system.w" :height="system.h" 支付宝必须要这样设置宽高才有效果 -->
-      <canvas
-        class="canvas"
-        :canvas-id="canvasId"
-        :id="canvasId"
-        :style="'width:' + system.w + 'px; height:' + system.h + 'px;'"
-        :width="system.w"
-        :height="system.h"
-      ></canvas>
-      <view class="button-wrapper">
-        <!-- 保存海报按钮 -->
-        <!-- #ifndef MP-QQ -->
-        <!-- cover-view 标签qq小程序有问题 -->
-        <cover-view class="save-btn cancel-btn" @tap="handleCancel">取消</cover-view>
-        <!-- #endif -->
-        <!-- #ifdef MP-QQ -->
-        <view class="save-btn cancel-btn" @tap="handleCancel">取消</view>
-        <!-- #endif -->
-      </view>
-    </view>
-  </view>
-</template>
-
-<script>
-  import { drawSquarePic, drawTextReturnH, getSystem } from './utils'
-  export default {
-    data() {
-      return {
-        canvasId: 'canvas',
-        system: {},
-        canvasShow: false,
-        square1: {
-          //正方形
-          x: 40,
-          y: 40,
-          r: 0, //圆角半径
-          w: 80, //宽度
-          h: 80 //高度
-        },
-        square2: {
-          //圆角方形
-          x: 40,
-          y: 40,
-          r: 10, //圆角半径
-          w: 80, //宽度
-          h: 80 //高度
-        },
-        square3: {
-          //圆形
-          x: 40,
-          y: 40,
-          r: 40, //圆角半径
-          w: 80, //宽度
-          h: 80 //高度
-        },
-        pic1: {
-          x: 40,
-          y: 40,
-          url: 'https://huangchunhongzz.gitee.io/imgs/poster/product.png',
-          r: 0, //圆角半径
-          w: 250, //宽度
-          h: 200 //高度
-        },
-        text1: {
-          x: 0,
-          y: 40,
-          text: '今日上新水果,牛奶草莓',
-          fontSize: 16, //字体大小
-          color: '#000', //颜色
-          lineHeight: 25, //行高
-          mt: 0 //margin-top
-        },
-        text2: {
-          x: 0,
-          y: 40,
-          text: '今日上新水果,牛奶草莓',
-          fontSize: 16, //字体大小
-          color: 'blue', //颜色
-          lineHeight: 25, //行高
-          mt: 0, //margin-top
-          align: 'center' //对齐方式
-        },
-        text3: {
-          x: 0,
-          y: 40,
-          text: '今日上新水果,牛奶草莓',
-          fontSize: 16, //字体大小
-          color: 'red', //颜色
-          lineHeight: 25, //行高
-          mt: 0, //margin-top
-          align: 'right' //对齐方式
-        }
-      }
-    },
-    created() {
-      // 获取设备信息
-      this.system = getSystem()
-    },
-    methods: {
-      /**
-       * @description: 展示海报
-       * @param {type}
-       * @return {type}
-       * @author: hch
-       */
-      handleDraw(type) {
-        console.log('handleDraw -> type', type)
-        this.canvasShow = true
-        this.draw(type)
-      },
-      /**
-       * @description: 绘制
-       * @author: hch
-       */
-      draw(type) {
-        uni.showLoading({
-          title: '绘制中...'
-        })
-        if (this.ctx) {
-          this.ctx.clearRect(0, 0, this.system.w, this.system.h) //清空之前的海报
-          this.ctx.restore() //恢复之前被切割的canvas,否则切割之外的就没办法用
-        } else {
-          this.ctx = uni.createCanvasContext(this.canvasId, this)
-        }
-        let drawData = this[type]
-        if (type === 'square1' || type === 'square2' || type === 'square3' || type === 'pic1') {
-          // 绘制图像/图片
-          drawSquarePic(
-            this.ctx,
-            drawData.x,
-            drawData.y,
-            drawData.w,
-            drawData.h,
-            drawData.r,
-            drawData.url
-          )
-        } else {
-          // 绘制文本
-          let textY = drawTextReturnH(
-            this.ctx,
-            drawData.text,
-            drawData.x,
-            drawData.y,
-            this.system.w,
-            drawData.fontSize,
-            drawData.color,
-            drawData.lineHeight,
-            drawData.align
-          )
-        }
-
-        uni.hideLoading()
-      },
-      /**
-       * @description: 取消海报
-       * @param {type}
-       * @return {type}
-       * @author: hch
-       */
-      handleCancel() {
-        this.canvasShow = false
-      }
-    }
-  }
-</script>
-
-<style lang="scss">
-  .content {
-    margin-bottom: 80rpx;
-    overflow: hidden;
-    border-bottom: 1rpx solid $uni-border-color;
-
-    .btn {
-      float: left;
-      width: 30%;
-      margin: 10rpx;
-      font-size: 30rpx;
-      line-height: 72rpx;
-      color: #fff;
-      text-align: center;
-      background: $uni-btn-color;
-      border-radius: 45rpx;
-      border-radius: 36rpx;
-    }
-  }
-
-  .canvas-content {
-    position: absolute;
-    top: 0;
-    z-index: 9;
-
-    .canvas-mask {
-      position: fixed;
-      top: 0;
-      right: 0;
-      bottom: 0;
-      left: 0;
-      z-index: 9;
-      width: 100%;
-      height: 100%;
-      background: $uni-btn-color;
-    }
-
-    .canvas {
-      z-index: 10;
-    }
-
-    .button-wrapper {
-      position: fixed;
-      bottom: 20rpx;
-      z-index: 16;
-      display: flex;
-      width: 100%;
-      height: 72rpx;
-      justify-content: space-around;
-    }
-
-    .save-btn {
-      z-index: 16;
-      width: 40%;
-      height: 100%;
-      font-size: 30rpx;
-      line-height: 72rpx;
-      color: #fff;
-      text-align: center;
-      background: $uni-btn-color;
-      border-radius: 45rpx;
-      border-radius: 36rpx;
-    }
-
-    .cancel-btn {
-      color: $uni-btn-color;
-      background: #fff;
-    }
-
-    .canvas-close-btn {
-      position: fixed;
-      top: 30rpx;
-      right: 0;
-      z-index: 12;
-      width: 60rpx;
-      height: 60rpx;
-      padding: 20rpx;
-    }
-  }
-</style>

+ 0 - 402
components/hch-poster/hch-poster.vue

@@ -1,402 +0,0 @@
-<!--
- * @Description: 生成图片组件
- * @Version: 1.0.0
- * @Autor: hch
- * @Date: 2020-08-07 14:48:41
- * @LastEditors: Please set LastEditors
- * @LastEditTime: 2021-07-31 18:11:35
- * 保存图片按钮和关闭按钮 在html代码中写出来 绑定点击方法然后透明 再用canvas 覆盖
--->
-
-<template>
-	<view class="canvas-content" v-show="canvasShow" :style="'width:' + system.w + 'px; height:' + system.h + 'px;'">
-		<!-- 遮罩层 -->
-		<view class="canvas-mask"></view>
-		<!-- 图片 -->
-		<!-- :width="system.w" :height="system.h" 支付宝必须要这样设置宽高才有效果 -->
-		<canvas class="canvas" canvas-id="myCanvas" id="myCanvas"
-			:style="'width:' + system.w + 'px; height:' + system.h + 'px;'" :width="system.w"
-			:height="system.h"></canvas>
-		<view class="button-wrapper">
-			<!-- 保存图片按钮 -->
-			<!-- #ifndef MP-QQ -->
-			<!-- cover-view 标签qq小程序有问题 -->
-			<cover-view class="save-btn" @tap="handleSaveCanvasImage">保存</cover-view>
-			<cover-view class="save-btn cancel-btn" @tap="handleCanvasCancel">取消</cover-view>
-			<!-- #endif -->
-			<!-- #ifdef MP-QQ -->
-			<view class="save-btn" @tap="handleSaveCanvasImage">保存</view>
-			<view class="save-btn cancel-btn" @tap="handleCanvasCancel">取消</view>
-			<!-- #endif -->
-		</view>
-	</view>
-</template>
-
-<script>
-	import {
-		drawSquarePic,
-		drawTextReturnH,
-		getSystem
-	} from './utils'
-	export default {
-		data() {
-			return {
-				system: {},
-				canvasShow: false
-			}
-		},
-		props: {
-			posterData: {
-				type: Object,
-				default: () => {
-					return {}
-				}
-			}
-		},
-		computed: {
-			/**
-			 * @description: 计算图片背景数据
-			 * @param {*}
-			 * @return {*}
-			 * @author: hch
-			 */
-			poster() {
-				let data = this.posterData
-				let system = this.system
-				let posterBg = {
-					url: data.poster.url,
-					r: data.poster.r * system.scale,
-					w: data.poster.w * system.scale,
-					h: data.poster.h * system.scale,
-					x: (system.w - data.poster.w * system.scale) / 2,
-					y: (system.h - data.poster.h * system.scale) / 2,
-					p: data.poster.p * system.scale
-				}
-				return posterBg
-			},
-			/**
-			 * @description: 计算图片头部主图
-			 * @param {*}
-			 * @return {*}
-			 * @author: hch
-			 */
-			square3() {
-				let data = this.posterData
-				let system = this.system
-				let posterMain = {
-					r: data.square3.r * system.scale,
-					w: data.square3.w * system.scale,
-					h: data.square3.h * system.scale,
-					x: (system.w - data.square3.w * system.scale) / 2,
-					y: this.poster.y + data.poster.p + data.square3.mt * system.scale,
-					color: '#E96737'
-				}
-				return posterMain
-			},
-
-			title() {
-				let data = this.posterData
-				let system = this.system
-				let posterTitle = data.title
-				posterTitle.x = this.square3.x
-				posterTitle.y = this.square3.y + 30 * system.scale
-				return posterTitle
-			},
-
-			num() {
-				let data = this.posterData
-				let system = this.system
-				let posterTitle = data.num
-				posterTitle.x = this.square3.x
-				posterTitle.y = this.square3.y + 100 * system.scale
-				return posterTitle
-			},
-
-			txt() {
-				let data = this.posterData
-				let system = this.system
-				let posterTitle = data.txt
-				posterTitle.x = this.square3.x
-				posterTitle.y = this.square3.y + 150 * system.scale
-				return posterTitle
-			},
-		},
-		created() {
-			// 获取设备信息
-			this.system = getSystem()
-		},
-		methods: {
-			/**
-			 * @description: 展示图片
-			 * @param {type}
-			 * @return {type}
-			 * @author: hch
-			 */
-			posterShow() {
-				this.canvasShow = true
-				this.creatPoster()
-			},
-			/**
-			 * @description: 生成图片
-			 * @author: hch
-			 */
-			async creatPoster() {
-				uni.showLoading({
-					title: '生成图片中...'
-				})
-				const ctx = uni.createCanvasContext('myCanvas', this)
-				this.ctx = ctx
-				ctx.clearRect(0, 0, this.system.w, this.system.h) //清空之前的图片
-				ctx.draw() //清空之前的图片
-				// 根据设备屏幕大小和距离屏幕上下左右距离,及圆角绘制背景
-				let poster = this.poster
-				let square3 = this.square3
-				let title = this.title
-				let num = this.num
-				let txt = this.txt
-				await drawSquarePic(ctx, poster.x, poster.y, poster.w, poster.h, poster.r, poster.url)
-				await drawSquarePic(ctx, square3.x, square3.y, square3.w, square3.h, square3.r, square3.url, square3
-					.color)
-				// 绘制标题 textY 绘制文本的y位置
-				// console.log('creatPoster -> title.x', title.x)
-				let textY = drawTextReturnH(
-					this.ctx,
-					title.text,
-					title.x,
-					title.y,
-					this.system.w,
-					title.fontSize,
-					title.color,
-					title.lineHeight,
-					title.align
-				)
-
-				let numY = drawTextReturnH(
-					this.ctx,
-					num.text,
-					num.x,
-					num.y,
-					this.system.w,
-					num.fontSize,
-					num.color,
-					num.lineHeight,
-					num.align
-				)
-
-				let txtY = drawTextReturnH(
-					this.ctx,
-					txt.text,
-					txt.x,
-					txt.y,
-					this.system.w,
-					txt.fontSize,
-					txt.color,
-					txt.lineHeight,
-					txt.align
-				)
-
-				uni.hideLoading()
-			},
-			/**
-			 * @description: 保存到系统相册
-			 * @param {type}
-			 * @return {type}
-			 * @author: hch
-			 */
-			handleSaveCanvasImage() {
-				uni.showLoading({
-					title: '保存中...'
-				})
-				let _this = this
-				// 把画布转化成临时文件
-				// #ifndef MP-ALIPAY
-				// 支付宝小程序外,其他都是用这个方法 canvasToTempFilePath
-				uni.canvasToTempFilePath({
-						x: this.poster.x,
-						y: this.poster.y,
-						width: this.poster.w, // 画布的宽
-						height: this.poster.h, // 画布的高
-						destWidth: this.poster.w * 5,
-						destHeight: this.poster.h * 5,
-						canvasId: 'myCanvas',
-						success(res) {
-							//保存图片至相册
-							// #ifndef H5
-							// 除了h5以外的其他端
-							uni.saveImageToPhotosAlbum({
-								filePath: res.tempFilePath,
-								success(res) {
-									uni.hideLoading()
-									uni.showToast({
-										title: '图片保存成功',
-										duration: 2000,
-										icon: 'none'
-									})
-									_this.handleCanvasCancel()
-									_this.handleCanvasConfirm()
-								},
-								fail() {
-									uni.showToast({
-										title: '保存失败,稍后再试',
-										duration: 2000,
-										icon: 'none'
-									})
-									uni.hideLoading()
-								}
-							})
-							// #endif
-
-							// #ifdef H5
-							// h5的时候
-							uni.showToast({
-								title: '请长按保存',
-								duration: 3000,
-								icon: 'none'
-							})
-							_this.handleCanvasCancel()
-							_this.$emit('previewImage', res.tempFilePath)
-							// #endif
-						},
-						fail(res) {
-							// console.log('fail -> res', res)
-							uni.showToast({
-								title: '保存失败,稍后再试',
-								duration: 2000,
-								icon: 'none'
-							})
-							uni.hideLoading()
-						}
-					},
-					this
-				)
-				// #endif
-				// #ifdef MP-ALIPAY
-				// 支付宝小程序条件下 toTempFilePath
-				this.ctx.toTempFilePath({
-						x: this.poster.x,
-						y: this.poster.y,
-						width: this.poster.w, // 画布的宽
-						height: this.poster.h, // 画布的高
-						destWidth: this.poster.w * 5,
-						destHeight: this.poster.h * 5,
-						success(res) {
-							//保存图片至相册
-							my.saveImage({
-								url: res.apFilePath,
-								showActionSheet: true,
-								success(res) {
-									uni.hideLoading()
-									uni.showToast({
-										title: '图片保存成功',
-										duration: 2000,
-										icon: 'none'
-									})
-									_this.handleCanvasCancel()
-								},
-								fail() {
-									uni.showToast({
-										title: '保存失败,稍后再试',
-										duration: 2000,
-										icon: 'none'
-									})
-									uni.hideLoading()
-								}
-							})
-						},
-						fail(res) {
-							// console.log('fail -> res', res)
-							uni.showToast({
-								title: '保存失败,稍后再试',
-								duration: 2000,
-								icon: 'none'
-							})
-							uni.hideLoading()
-						}
-					},
-					this
-				)
-				// #endif
-			},
-			/**
-			 * @description: 取消图片
-			 * @param {type}
-			 * @return {type}
-			 * @author: hch
-			 */
-			handleCanvasCancel() {
-				this.canvasShow = false
-				this.$emit('cancel', true)
-			},
-
-			handleCanvasConfirm() {
-				this.$emit('canvasConfirm')
-			}
-		}
-	}
-</script>
-
-<style lang="scss">
-	.content {
-		height: 100%;
-		text-align: center;
-	}
-
-	.canvas-content {
-		position: absolute;
-		top: 0;
-
-		.canvas-mask {
-			position: fixed;
-			top: 0;
-			right: 0;
-			bottom: 0;
-			left: 0;
-			z-index: 200;
-			width: 100%;
-			height: 100%;
-			background: rgba(0, 0, 0, 0.5);
-		}
-
-		.canvas {
-			z-index: 200;
-		}
-
-		.button-wrapper {
-			position: fixed;
-			bottom: 80rpx;
-			z-index: 200;
-			display: flex;
-			width: 100%;
-			height: 72rpx;
-			justify-content: space-around;
-		}
-
-		.save-btn {
-			z-index: 16;
-			width: 40%;
-			height: 100%;
-			font-size: 30rpx;
-			line-height: 72rpx;
-			color: #fff;
-			text-align: center;
-			background: $uni-btn-color;
-			border-radius: 45rpx;
-			border-radius: 36rpx;
-		}
-
-		.cancel-btn {
-			color: $uni-btn-color;
-			background: #fff;
-		}
-
-		.canvas-close-btn {
-			position: fixed;
-			top: 30rpx;
-			right: 0;
-			z-index: 12;
-			width: 60rpx;
-			height: 60rpx;
-			padding: 20rpx;
-		}
-	}
-</style>

+ 0 - 54
components/image-show/image-show.vue

@@ -1,54 +0,0 @@
-<template>
-	<view>
-		<u-overlay :show="imageShow" @click="imageClose" :opacity="0.9">
-			<view class="flex warp">
-				<view class="rect" @tap.stop>
-					<image :src="imageUrl" mode="scaleToFill"></image>
-				</view>
-			</view>
-		</u-overlay>
-	</view>
-</template>
-
-<script>
-	export default {
-		name: "image-show",
-		props: {
-			imageShow: {
-				type: [Boolean],
-				default: false
-			},
-			imageUrl: {
-				type: [String, Number],
-				default: ''
-			}
-		},
-		data() {
-			return {
-
-			};
-		},
-		methods:{
-			imageClose(){
-				this.$emit('close')
-			},
-		}
-	}
-</script>
-
-<style lang="scss" scoped>
-	.warp {
-		width: 100%;
-		height: 100%;
-	}
-
-	.rect {
-		width: 100%;
-		max-height: 700rpx;
-		background-color: #fff;
-	}
-	
-	image{
-		width: 100%;
-	}
-</style>

+ 0 - 20
components/index-ticket/index-ticket.vue

@@ -1,20 +0,0 @@
-<template>
-	<view>
-		
-	</view>
-</template>
-
-<script>
-	export default {
-		name:"index-ticket",
-		data() {
-			return {
-				
-			};
-		}
-	}
-</script>
-
-<style lang="scss">
-
-</style>

+ 107 - 0
components/prize-barrage/prize-barrage.vue

@@ -0,0 +1,107 @@
+<template>
+	<view>
+		<view class="prize-news">
+			<view class="prize-news-item" :style="{ animation: activeAnimation }">
+				<view class="prize-news-item-one" v-for="(item, index) in barrageList" :key="index">
+					<image class="img" :src="item.avatar" lazy-load mode="aspectFill"></image>
+					<view class="title">
+						<view class="name">恭喜</view>
+						<view class="prize">{{ item.nickName }}</view>
+						<view class="name">{{ item.type == 1 ? '刮出了' : '兑换了' }}</view>
+						<view class="prize">{{ item.prizeInfo }}</view>
+					</view>
+				</view>
+			</view>
+			<view class="prize-news-item" :style="{ animation: activeAnimation }">
+				<view class="prize-news-item-one" v-for="(item, index) in barrageList" :key="index">
+					<image class="img" :src="item.avatar" lazy-load mode="aspectFill"></image>
+					<view class="title">
+						<view class="name">恭喜</view>
+						<view class="prize">{{ item.nickName }}</view>
+						<view class="name">{{ item.type == 1 ? '刮出了' : '兑换了' }}</view>
+						<view class="prize">{{ item.prizeInfo }}</view>
+					</view>
+				</view>
+			</view>
+		</view>
+	</view>
+</template>
+
+<script>
+	export default {
+		name: "prize-barrage",
+		props: {
+			barrageList: {
+				type: Array,
+				default: () => []
+			},
+			time: {
+				type: [Number, String],
+				default: 10
+			},
+		},
+		data() {
+			return {
+				activeAnimation: "moveLeft 10s linear infinite normal"
+			};
+		},
+		created() {
+			this.setAnimation()
+		},
+		methods: {
+			setAnimation() {
+				let time = Math.ceil(this.barrageList.length / 5 * this.time)
+				this.activeAnimation = `moveLeft ${ time }s linear infinite normal`
+			}
+		}
+	}
+</script>
+
+<style lang="scss" scoped>
+	.prize-news {
+		display: flex;
+		width: 100vw;
+		height: 50rpx;
+		margin-bottom: 12rpx;
+		overflow: hidden;
+
+		.prize-news-item {
+			display: flex;
+			height: 50rpx;
+
+			.prize-news-item-one {
+				display: flex;
+				align-items: center;
+				padding: 0 40rpx 0 4rpx;
+				height: 50rpx;
+				background: rgba(255, 255, 255, .5);
+				border-radius: 25rpx;
+				font-size: 24rpx;
+
+				margin-right: 60rpx;
+				.img {
+					display: inline-block;
+					width: 46rpx;
+					height: 46rpx;
+					vertical-align: middle;
+					border-radius: 50%;
+				}
+
+				.title {
+					display: flex;
+					align-items: center;
+
+					.name {
+						white-space: nowrap;
+						margin: 0 16rpx;
+					}
+
+					.prize {
+						white-space: nowrap;
+						color: #F27120;
+					}
+				}
+			}
+		}
+	}
+</style>

+ 0 - 206
components/prize-news/prize-news.vue

@@ -1,206 +0,0 @@
-<!-- 横向滚动播放 -->
-<template>
-	<view class='text-scroll-wrap'>
-		<view class="text-content" :style="{ left:leftMove+'px' }">
-			<view class="text-item" v-for="(item,index) in myList" :key="index">
-				<view class="text">
-					<image :src="item.avatar" class="image"></image>
-					<view class="title">
-						<view class="name">恭喜</view>
-						<view class="prize">{{ item.nickName }}</view>
-						<view class="name">{{ item.type == 1 ? '刮出了' : '兑换了' }}</view>
-						<view class="prize">{{ item.prizeInfo }}</view>
-					</view>
-				</view>
-			</view>
-		</view>
-	</view>
-</template>
-
-<script>
-	export default {
-		name: 'prize-news',
-		components: {},
-		props: {
-			list: { // 滚动列表
-				type: Array,
-				default: () => {
-					return [{
-						nickName: '测试'
-					},{
-						nickName: '测试'
-					}];
-				}
-			},
-			type: { // 类型
-				type: String,
-				default: 'text',
-				validator: (value) => {
-					return ['text', 'image'].indexOf(value) !== -1;
-				}
-			},
-			textKey: { // 文字key值
-				type: String,
-				default: ''
-			},
-			imageKey: { // 图片key值
-				type: String,
-				default: ''
-			},
-			actives: { // 如果需要,此为已选列表
-				type: Array,
-				default: () => {
-					return [];
-				}
-			},
-			duration: { // 间隔时间
-				type: [Number, String],
-				default: 20
-			},
-			delay: { // 延迟时间
-				type: [Number, String],
-				default: 0
-			},
-			initPosition: { // 初始位置
-				type: String,
-				default: 'left',
-				validator: (value) => {
-					return ['left', 'right'].indexOf(value) !== -1;
-				}
-			}
-		},
-		data() {
-			return {
-				myList: [],
-				leftMove: 0,
-				firstItemWidth: 0,
-				wrapWidth: 0,
-			};
-		},
-		// 组件实例化之前
-		beforeCreate() {},
-		// 组件创建完成
-		created() {
-			this.myList = this.list;
-		},
-		// 组件挂载之前
-		beforeMount() {},
-		// 组件挂载之后
-		mounted() {
-			let query = uni.createSelectorQuery().in(this);
-			query.select('.text-item').boundingClientRect(data => {
-				this.firstItemWidth = data.width;
-			}).exec();
-			query.select('.text-scroll-wrap').boundingClientRect(data => {
-				this.wrapWidth = data.width;
-				this.initPosition === 'left' ? this.leftMove = 0 : this.leftMove = this.wrapWidth;
-			}).exec();
-			if (this.delay <= 0) {
-				this.scrollContent();
-			} else {
-				let t = setTimeout(() => {
-					clearTimeout(t);
-					this.scrollContent();
-				}, Number(this.delay));
-			}
-
-		},
-		// 组件数据更新时
-		beforeUpdate() {},
-		// 组价更新
-		updated() {},
-		// 组件销毁前
-		beforeDestroy() {},
-		// 组件销毁后
-		destroyed() {},
-		// 页面方法
-		methods: {
-			// 点击此项
-			clickThis(e) {
-				// console.log(e.currentTarget.dataset.text);
-				this.$emit('change', e.currentTarget.dataset.text);
-			},
-			// 滚动
-			scrollContent() {
-				let num = this.initPosition === 'left' ? 0 : this.wrapWidth;
-				setInterval(() => {
-					num--;
-					if (num < 0 && Math.abs(num) >= this.firstItemWidth) {
-						this.myList.push(this.myList[0]);
-						this.myList.splice(0, 1);
-						num += this.firstItemWidth;
-						let query = uni.createSelectorQuery().in(this);
-						query.selectAll('.text-item').boundingClientRect(data => {
-							this.firstItemWidth = data[1].width;
-						}).exec();
-					}
-					this.leftMove = num;
-				}, Number(this.duration));
-			}
-		}
-	};
-</script>
-
-<style lang='scss'>
-	.text-scroll-wrap {
-		overflow: hidden;
-		width: 100%;
-		height: 50rpx;
-		line-height: 50rpx;
-		margin-bottom: 12rpx;
-		position: relative;
-
-		.text-content {
-			display: inline-block;
-			white-space: nowrap;
-			height: 100%;
-			position: absolute;
-			top: 0;
-
-			.text-item {
-				height: 100%;
-				display: inline-block;
-				overflow: hidden;
-				font-size: 28rpx;
-				color: #666;
-
-				.text {
-					display: flex;
-					align-items: center;
-					height: 50rpx;
-					padding: 0 40rpx 0 4rpx;
-					margin: 0 60rpx;
-					background: rgba(255, 255, 255, .5);
-					border-radius: 25rpx;
-					font-size: 24rpx;
-
-					.image {
-						display: inline-block;
-						width: 46rpx;
-						height: 46rpx;
-						vertical-align: middle;
-						border-radius: 50%;
-					}
-					
-					.title {
-						display: flex;
-						align-items: center;
-						
-						.name{
-							margin: 0 16rpx;
-						}
-						
-						.prize{
-							color: #F27120;
-						}
-					}
-				}
-
-				&.active .text {
-					background: #1E90FF;
-					color: #fff;
-				}
-			}
-		}
-	}
-</style>

+ 1 - 1
components/share-code/share-code.vue

@@ -37,7 +37,7 @@
 		drawSquarePic,
 		drawTextReturnH,
 		getSystem
-	} from './utils'
+	} from '@/common/poster'
 	export default {
 		data() {
 			return {

+ 0 - 139
components/share-code/utils/index.js

@@ -1,139 +0,0 @@
-/*
- * @Description: 公共方法
- * @Version: 1.0.0
- * @Autor: hch
- * @Date: 2021-07-22 00:01:09
- */
-/**
- * @description: 绘制正方形(可以定义圆角),并且有图片地址的话填充图片
- * @param {CanvasContext} ctx canvas上下文
- * @param {number} x 圆角矩形选区的左上角 x坐标
- * @param {number} y 圆角矩形选区的左上角 y坐标
- * @param {number} w 圆角矩形选区的宽度
- * @param {number} h 圆角矩形选区的高度
- * @param {number} r 圆角的半径
- * @param {String} url 图片的url地址
- */
-export function drawSquarePic(ctx, x, y, w, h, r, url) {
-  ctx.save()
-  ctx.beginPath()
-  // 绘制左上角圆弧
-  ctx.arc(x + r, y + r, r, Math.PI, Math.PI * 1.5)
-  // 绘制border-top
-  // 画一条线 x终点、y终点
-  ctx.lineTo(x + w - r, y)
-  // 绘制右上角圆弧
-  ctx.arc(x + w - r, y + r, r, Math.PI * 1.5, Math.PI * 2)
-  // 绘制border-right
-  ctx.lineTo(x + w, y + h - r)
-  // 绘制右下角圆弧
-  ctx.arc(x + w - r, y + h - r, r, 0, Math.PI * 0.5)
-  // 绘制左下角圆弧
-  ctx.arc(x + r, y + h - r, r, Math.PI * 0.5, Math.PI)
-  // 绘制border-left
-  ctx.lineTo(x, y + r)
-  // 填充颜色(需要可以自行修改)
-  ctx.setFillStyle('#ffffff')
-  ctx.fill()
-  // 剪切,剪切之后的绘画绘制剪切区域内进行,需要save与restore 这个很重要 不然没办法保存
-  ctx.clip()
-
-  // 绘制图片
-  return new Promise((resolve, reject) => {
-    if (url) {
-      uni.getImageInfo({
-        src: url,
-        success(res) {
-          ctx.drawImage(res.path, x, y, w, h)
-          ctx.restore() //恢复之前被切割的canvas,否则切割之外的就没办法用
-          ctx.draw(true)
-          resolve()
-        },
-        fail(res) {
-          console.log('fail -> res', res)
-          uni.showToast({
-            title: '图片下载异常',
-            duration: 2000,
-            icon: 'none'
-          })
-        }
-      })
-    } else {
-      ctx.draw(true)
-      resolve()
-    }
-  })
-}
-
-/**
- * @description: 获取设备信息
- * @param {type}
- * @return {type}
- * @author: hch
- */
-export function getSystem() {
-  let system = wx.getSystemInfoSync()
-  let scale = system.windowWidth / 375 //按照苹果留 375*667比例 其他型号手机等比例缩放 显示
-  return { w: system.windowWidth, h: system.windowHeight, scale: scale }
-}
-
-/**
- * @description: 绘制文本时文本的总体高度
- * @param {Object} ctx canvas上下文
- * @param {String} text 需要输入的文本
- * @param {Number} x X轴起始位置
- * @param {Number} y Y轴起始位置
- * @param {Number} maxWidth 单行最大宽度
- * @param {Number} fontSize 字体大小
- * @param {String} color 字体颜色
- * @param {Number} lineHeight 行高
- * @param {String} textAlign 字体对齐方式
- */
-export function drawTextReturnH(
-  ctx,
-  text,
-  x,
-  y,
-  maxWidth = 375,
-  fontSize = 14,
-  color = '#000',
-  lineHeight = 30,
-  textAlign = 'left'
-) {
-  if (textAlign) {
-    ctx.setTextAlign(textAlign) //设置文本的水平对齐方式  ctx.setTextAlign这个可以兼容百度小程序 ,注意:ctx.textAlign百度小程序有问题
-    switch (textAlign) {
-      case 'center':
-        x = getSystem().w / 2
-        break
-
-      case 'right':
-        x = (getSystem().w - maxWidth) / 2 + maxWidth
-        break
-
-      default:
-        // 左对齐
-        x = (getSystem().w - maxWidth) / 2
-        break
-    }
-  }
-  let arrText = text.split('')
-  let line = ''
-  for (let n = 0; n < arrText.length; n++) {
-    let testLine = line + arrText[n]
-    ctx.font = fontSize + 'px sans-serif' //设置字体大小,注意:百度小程序 用ctx.setFontSize设置字体大小后,计算字体宽度会无效
-    ctx.setFillStyle(color) //设置字体颜色
-    let metrics = ctx.measureText(testLine) //measureText() 方法返回包含一个对象,该对象包含以像素计的指定字体宽度。
-    let testWidth = metrics.width
-    if (testWidth > maxWidth && n > 0) {
-      ctx.fillText(line, x, y)
-      line = arrText[n]
-      y += lineHeight
-    } else {
-      line = testLine
-    }
-  }
-  ctx.fillText(line, x, y)
-  ctx.draw(true) //本次绘制是否接着上一次绘制。即 reserve 参数为 false,则在本次调用绘制之前 native 层会先清空画布再继续绘制;若 reserve 参数为 true,则保留当前画布上的内容,本次调用 drawCanvas 绘制的内容覆盖在上面,默认 false。
-  return y
-}

+ 1 - 1
packageGoods/ticket/index.vue

@@ -3,7 +3,7 @@
 		<u-navbar :placeholder="true" bgColor="#fff" :autoBack="true" :border="true" title="盲票列表"></u-navbar>
 		<view class="ticket-box">
 			<view class="flex ticket-box-list">
-				<navigator :url="`/packageGoods/ticket/detail?boxId=${ item.boxId }`" class="flex ticket-box-list-item"
+				<navigator :url="`/pages/ticketBox/detail?boxId=${ item.boxId }`" class="flex ticket-box-list-item"
 					hover-class="navigator-hover" v-for="(item, index) in list" :key="index">
 					<image :src="item.picUrl" mode="aspectFill"></image>
 					<view class="info">

+ 1 - 1
packageOperate/share/index.vue

@@ -125,7 +125,7 @@
 		onShareAppMessage(res) {
 			return {
 				title: '分享盲票',
-				path: `/packageGoods/ticket/detail?boxId=${ this.boxId }&userId=${ this.userInfo.userId }&type=1`,
+				path: `/pages/ticketBox/detail?boxId=${ this.boxId }&userId=${ this.userInfo.userId }&type=1`,
 				type: 2,
 			}
 		}

+ 1 - 1
packagePrize/choice/index.vue

@@ -214,7 +214,7 @@
 							const url = res.result
 							let serialNo = url.substring(url.length - 21, url.length)
 							uni.redirectTo({
-								url: `/packageOperate/lucky/index?id=${ serialNo }&type=offLine`
+								url: `/pages/lucky/index?id=${ serialNo }&type=offLine`
 							})
 						},
 						fail() {

+ 8 - 8
pages.json

@@ -13,6 +13,12 @@
 		},
 		{
 			"path": "pages/login/code"
+		},
+		{
+			"path": "pages/lucky/index"
+		},
+		{
+			"path": "pages/ticketBox/detail"
 		}
 	],
 	"subPackages": [{
@@ -43,9 +49,6 @@
 				},
 				{
 					"path": "ticket/index"
-				},
-				{
-					"path": "ticket/detail"
 				}
 			]
 		},
@@ -82,9 +85,6 @@
 				{
 					"path": "address/create"
 				},
-				{
-					"path": "lucky/index"
-				},
 				{
 					"path": "process/index"
 				},
@@ -118,11 +118,11 @@
 			"network": "all",
 			"packages": ["packageGoods", "packagePrize", "packageOperate", "packageOther"]
 		},
-		"packageOperate/lucky/index": {
+		"pages/lucky/index": {
 			"network": "all",
 			"packages": ["packageOperate", "packageGoods", "packagePrize", "packageOther"]
 		},
-		"packageGoods/ticket/detail": {
+		"pages/ticketBox/detail": {
 			"network": "all",
 			"packages": ["packageGoods", "packagePrize", "packageOperate", "packageOther"]
 		}

+ 7 - 7
pages/index/index.vue

@@ -21,10 +21,10 @@
 					</view>
 				</view>
 				<!-- 弹幕 -->
-				<!-- <view class="box-top-news">
-					<prize-news :list="prizeNewsListOne" duration="20" v-if="prizeNewsListOne.length" />
-					<prize-news :list="prizeNewsListTwo" duration="15" v-if="prizeNewsListTwo.length" />
-				</view> -->
+				<view class="box-top-news">
+					<prize-barrage :barrageList="prizeNewsListOne" :time="20" v-if="prizeNewsListOne.length" />
+					<prize-barrage :barrageList="prizeNewsListTwo" :time="15" v-if="prizeNewsListTwo.length" />
+				</view>
 			</view>
 			<view class="box-ticket">
 				<!-- 盲票 -->
@@ -86,12 +86,12 @@
 	import $http from '@/utils/request.js'
 	import CustomTabBar from '../../components/custom-tab-bar/custom-tab-bar.vue'
 	import PayPopup from '../../components/pay-popup/pay-popup.vue'
-	// import PrizeNews from '../../components/prize-news/prize-news.vue'
+	import PrizeBarrage from '@/components/prize-barrage/prize-barrage.vue'
 	export default {
 		components: {
 			CustomTabBar,
 			PayPopup,
-			// PrizeNews,
+			PrizeBarrage
 		},
 		data() {
 			return {
@@ -289,7 +289,7 @@
 			toTicketBox() {
 				let item = this.ticketList[this.currentIndex]
 				uni.navigateTo({
-					url: `/packageGoods/ticket/detail?boxId=${ item.boxId }`
+					url: `/pages/ticketBox/detail?boxId=${ item.boxId }`
 				})
 			},
 

+ 1 - 8
packageOperate/lucky/index.vue → pages/lucky/index.vue

@@ -92,8 +92,6 @@
 				<navigator open-type="exit" target="miniProgram" hover-class="none" class="btn">确认</navigator>
 			</view>
 		</u-popup>
-
-		<hch-poster ref="hchPoster" :posterData.sync="posterData" />
 	</view>
 </template>
 
@@ -101,12 +99,10 @@
 	import env from '../../config/env.js'
 	import $http from '@/utils/request.js'
 	import PayPopup from '../../components/pay-popup/pay-popup.vue'
-	import HchPoster from "../../components/hch-poster/hch-poster.vue"
 
 	export default {
 		components: {
-			PayPopup,
-			HchPoster
+			PayPopup
 		},
 		data() {
 			return {
@@ -116,11 +112,8 @@
 				payShow: false,
 				payLookFlag: true,
 				showNull: false,
-				posterData: {},
-
 				luckyShow: true,
 				status: 2,
-
 				boxId: '',
 				picUrlArr: [],
 				boxInfo: {},

+ 0 - 0
packageGoods/ticket/detail.vue → pages/ticketBox/detail.vue