修改preview的例子代码

by qianjun;fix bugs